Reserving/Preallocating associative array?

Gordon me at home.com
Fri Dec 27 08:49:30 PST 2013


On Friday, 27 December 2013 at 09:37:09 UTC, Benjamin Thaut wrote:
> Am 25.12.2013 17:12, schrieb Gordon:
>
> So I was interrested how far you can take this. The version 
> bearophile posted runs in 14 seconds (48420527 ticks) on my 
> machine.
>
<...>
>
> At this point the profiler looked something like this:
> 50%  find free entry in hashmap
> 21%  parse uint
> 9%   find end of line + tab
> 3.5% read data from disk
>

This is turning into very interesting (and useful) discussion. 
Thank you!

I've created a generic "FileSlurp" library, to load a file (using 
"byLineFast") and use a delegate to store the data (so I can 
later use any improved methods you suggest).
It's available here, comments are welcomed:
   http://code.dlang.org/packages/fileslurp

Benjamin,
Can you point me to your Hashmap implementation? I could perhaps 
use it to improve the timings even more.

Bearophile,
Who is "JM" who wrote "byLineFast" ? I'm using his code and would 
like to properly acknowledge him/her.

Thanks!
  -gordon



More information about the Digitalmars-d mailing list