Reserving/Preallocating associative array?
Marco Leise
Marco.Leise at gmx.de
Thu Dec 26 22:24:40 PST 2013
Am Wed, 25 Dec 2013 16:12:09 +0000
schrieb "Gordon" <me at home.com>:
> 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
So for the record: The garbage collector slowed down this
piece of code by a factor of 6.6
--
Marco
More information about the Digitalmars-d
mailing list