multithread GC more slower?

Sean Kelly sean at invisibleduck.org
Tue Jun 16 22:02:07 PDT 2009


zsxxsz wrote:
> I start two threads, one is producter and the other is consumer. I found if GC was enable, the time cost was 24 seconds, and if GC was disable, the time cost was 4 seconds. Why is GC so slowly in multi-threads?

If the GC is disabled then no collections will occur until the app is no 
longer able to obtain any additional memory from the OS.  It's these 
collections that are adding run time.  You might want to consider 
deleting the job objects even if the GC is enabled to avoid unnecessary 
collections.


More information about the Digitalmars-d-bugs mailing list