Reserving/Preallocating associative array?

Gordon me at home.com
Wed Dec 25 08:12:09 PST 2013


On Wednesday, 25 December 2013 at 08:27:53 UTC, Philippe Sigaud 
wrote:
> Out of curiosity, do you know which one of his 3 suggestions 
> brought you
> the highest speed boost? What happens if you do not disable the 
> GC, for
> example?

Good question, I did test each one incrementally:

1. Switching from "split+to!size_t" to "parse" (and commenting 
out the "union") reduced running time from ~26s to ~20s (on 
average).

2. Switching from "byLine" to "byLineFast" (and commenting out 
the "union") reduced running time from ~20s to ~14s (on average).

3. With "parse" and "byLineFast", and with GC still on, and 
populating the "union" the program took about 2m45s .

4. Adding "GC.disable" brought it down to 25s.

HTH,
  -gordon


More information about the Digitalmars-d mailing list