3 ms·
Yeah, atomic RC hurts a lot (5x-10x slower, based on the measurements I've seen -- Hans Boehm of Boehm GC fame did a presentation on this that you can find if y
by ootachi 15y ago
Yeah, atomic RC hurts a lot (5x-10x slower, based on the measurements I've seen -- Hans Boehm of Boehm GC fame did a presentation on this that you can find if you're interested). (This is a problem with Objective-C reference counting -- they use atomic ops for all reference counting I believe.) There's some work on mitigating its cost with per-thread reference counts arranged in a tree or whatever, but it's still tough.
The alternatives are either (a) avoiding shared state; (b) strong lifetime management such that you make sure one parent thread owns all of the data that its child threads are going to use; (c) concurrent GC; (d) pretending it's not a problem like Go does and doing stop-the-world GC.
- angersock 15y agoHm... interesting. Looks like we might want to expand our library to have RC with and without atomic ops--that way we can get some of the cleanness of scoped destruction when appropriate without having to go whole-hog ATOMIC RC INVALIDATE ALL THE THINGS when we can getaway with it. Thanks again folks!