Notes 5, GC performance

Sean Kelly sean at invisibleduck.org
Wed Apr 16 07:48:52 PDT 2008


== Quote from bearophile (bearophileHUGS at lycos.com)'s article
...
> (The std.gc.disable is nearly necessary, otherwise it burns more than 5 seconds to create the AA).
> The timings on 503_000 distinct words, 6.3 MB are:
>   t1-t0 = 1.76 s
>   Total running time: 3.57 s
> I think it's strange that it takes more time to destroy an AA than to find all the hashing valees and create it.

The Phobos GC is not aware of types contained in AAs, so it will walways scan AA nodes regardless of
what's in them.  Tango's GC is a bit smarter (and I have a ticket pending to improve it further), but it
will still not be perfect because the compiler only passes in TypeInfo for the key, not the value, and
both are stored in the same memory block so if one must be scanned then the other will be also.
This could be the cause of the slowdown you're seeing.


Sean



More information about the Digitalmars-d mailing list