GC performance: collection frequency

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 17 01:26:17 PDT 2015


On 14-Sep-2015 21:47, H. S. Teoh via Digitalmars-d wrote:
> Over in the d.learn forum, somebody posted a question about poor
> performance in a text-parsing program. After a bit of profiling I
> discovered that reducing GC collection frequency (i.e., GC.disable()
> then manually call GC.collect() at some interval) improved program
> performance by about 20%.
>

One thing that any remotely production-quality GC does is analyze the 
result of collection with respect to minimal headroom - X % (typically 
30-50%). If we freed Y % of heap where Y < X, then the GC should extend 
the heap so that it get within X % mark of free space in the extended heap.


-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list