[D-runtime] Precise garbage collection

Rainer Schuetze r.sagitario at gmx.de
Mon Jun 24 23:31:11 PDT 2013


On 23.06.2013 18:34, Andrei Alexandrescu wrote:
> On 6/21/13 11:36 AM, Rainer Schuetze wrote:
>> I want to make precise garbage collection as presented at the D
>> conference ready for inclusion into druntime.
>
> I'm all for this. One area we should be careful about is not introducing
> performance regressions.
>

One thing we can do to mitigate the additional cost when allocating: 
make all GC functions nothrow (they are declared to be nothrow anyway in 
core.memory, but this gets lost by different extern(C) declarations). 
This removes exception-handling-unwinding from scope(exit) statements. 
Last time I tried, it improved performance of testgc3 from the test 
suite by about 5%.

When doing this I wondered why so many functions in druntime are 
declared extern(C) and are even declared again in other modules. 
Sometimes it is caused by an undesired dependency from core package to 
the rt package that should be invisible to the user of the core package, 
but this is rare. It gives the impression the module system is no good 
for systems programming :-p



More information about the D-runtime mailing list