The GC and performance, but not what you expect

Sean Kelly via Digitalmars-d digitalmars-d at puremagic.com
Thu May 29 12:55:38 PDT 2014


On Thursday, 29 May 2014 at 10:09:18 UTC, Atila Neves wrote:
>
> The GC is preventing me from beating Java, but not because of
> collections. It's the locking it does to allocate instead! I
> don't know about the rest of you but I definitely didn't see 
> that one coming.

This is sadly unavoidable with the current GC.  Simply put, it's
possible for a finalizer to spawn a thread, and so the GC always
has to lock before collecting, even if the program is
single-threaded at the beginning of the collection cycle.


More information about the Digitalmars-d mailing list