News for hackers. Stuff that matters.
Re:Comparison of C++17, Go, and Java for a next-generation s... by mcguire on Thursday April 23, 2020 @02:39PM (#22959420)
"With reference counting, objects are recognized as obsolete due to their reference counts dropping to zero. Deallocation of these objects leads to transitive deallocations of other objects because of their reference counts transitively dropping to zero. Since this is an inherently sequential process, this leads to a similar significant pause as with a stop-the-world garbage collector."

There are three primary performance penalties for reference counting:

1. This, where dropping one link causes a deallocation chain.

2. A typical heap implementation will leave live objects scattered throughout memory, leading to cache issues.

3. Maintaining the reference counts may cause writes to memory, leading to other cache issues, plus atomicity.

Re:Comparison of C++17, Go, and Java for a next-generation s... by Rochus on Thursday April 23, 2020 @03:13PM (#22959892)
People often forget that memory allocation is very expensive; the C/C++ default allocator is very inefficient.