Re:Chris Lattner on garbage collection vs. Automatic Referen...
by cmrdporcupine on Saturday April 23, 2022 @11:09PM
(#31140958)
There are RC systems where the counts are held external to the objects, which can be a bit more cache friendly.
[ Parent
| on HN ]
Re:Chris Lattner on garbage collection vs. Automatic Referen...
by Kranar on Sunday April 24, 2022 @01:45AM
(#31141581)
You want the opposite behavior in order to be cache friendly, an RC system where the counts are stored next to the object.
Re:Chris Lattner on garbage collection vs. Automatic Referen...
by cmrdporcupine on Sunday April 24, 2022 @08:56AM
(#31143502)
Not necessarily. The issue is that releasing a reference at the top of a tree of objects has the potential to walk a large graph of objects (doing downcounts at each) that are not in cache, causing some thrash.
In an ideal world and in a program running with a not-huge # of objects you could keep the entire basket of reference counts in L1 cache, separate from the objects. Then decrements would be potentially cheap. A bit utopian though.