shared array?

Laeeth Isharc via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 14 06:59:21 PDT 2015


On Monday, 14 September 2015 at 00:53:58 UTC, Jonathan M Davis 
wrote:
> Only the stack and the GC heap get scanned unless you tell the 
> GC about memory that was allocated by malloc or some other 
> mechanism. malloced memory won't be scanned by default. So, if 
> you're using the GC minimally and coding in a way that doesn't 
> involve needing to tell the GC about a bunch of malloced 
> memory, then the GC won't have all that much to scan. And while 
> the amount of memory that the GC has to scan does affect the 
> speed of a collection, in general, the less memory that's been 
> allocated by the GC, the faster a collection is.
>
> Idiomatic D code uses the stack heavily and allocates very 
> little on the GC heap.
...
> So, while the fact that D's GC is less than stellar is 
> certainly a problem, and we would definitely like to improve 
> that, the idioms that D code typically uses seriously reduce 
> the number of performance problems that we get.
>
> - Jonathan M Davis

Thank you for your posts on this (and the others), Jonathan.  I 
appreciate your taking the time to write so carefully and 
thoroughly, and I learn a lot from reading your work.


More information about the Digitalmars-d-learn mailing list