4 ms·
There are RC systems where the counts are held external to the objects, which can be a bit more cache friendly.
by cmrdporcupine 5y ago
There are RC systems where the counts are held external to the objects, which can be a bit more cache friendly.
- Kranar 5y agoYou want the opposite behavior in order to be cache friendly, an RC system where the counts are stored next to the object.
- cmrdporcupine 5y agoNot 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.