lobsters score: 3 · tags: rust
I’m not doubting the benchmarks, but I have trouble seeing how this can be fast. Gc::drop runs a (fairly expensive looking) scan whenever the target object’s refcount is > 1, which must be pretty common. That’s a significant write barrier. Or did I miss a later step where that gets optimized?
I’ve seen other ref-counting implementations with cycle collectors (e.g. Nim’s) and usually they only run the collector periodically (IIRC), not on every release.
score 1 · canonical
I can’t speak to this exact implementation, but as this is basically Bacon-Rajan cycle collection, it’s not fast, especially when you use it heavily, and especially when you compare it with a dedicated garbage collector.
There are Rc schemes that are about as fast as a dedicated garbage collector, but those are much, much more involved. The most recent and well known (that I know of) is LXR which builds on several different strategies such as Rc Immix
score 1 · canonical
