Idea #1 on integrating RC with GC

Michel Fortin michel.fortin at michelf.ca
Wed Feb 5 07:25:27 PST 2014


On 2014-02-05 12:25:48 +0000, "Francesco Cattoglio" 
<francesco.cattoglio at gmail.com> said:

> On Wednesday, 5 February 2014 at 12:12:01 UTC, Paulo Pinto wrote:
>> Yes, the GC just needs to check roots for already released blocks, if I 
>> am not mistaken.
> 
> Perhaps I lost some explanation in the discussions, but does this 
> improve performance in any way (other than allowing you to disable the 
> GC)?

In general ARC+GC would release memory faster so you need less memory 
overall. Less garbage memory blocks floating around might make 
processor caches more efficients. And less memory pressure means the GC 
itself runs less often, thus less pauses, and shorter pauses since 
there is less memory to scan.

On the other hand, if you allocate everything you need from the start 
and then just shuffle pointers around, ARC will make things slower.

So there's some good and some bad. It's hard to know exactly how much 
of each in practice without an implementation to take some measurements 
with real world programs. But what's certain is that with ARC the 
overhead is more evenly distributed in time.

-- 
Michel Fortin
michel.fortin at michelf.ca
http://michelf.ca



More information about the Digitalmars-d mailing list