2 ms·
I don't disagree on the benefits of RAII at all. I love it. It's a much cleaner and more general resource management idea than a tracing GC. But incrementing/d
by fauigerzigerk 10y ago
I don't disagree on the benefits of RAII at all. I love it. It's a much cleaner and more general resource management idea than a tracing GC.
But incrementing/decrementing an atomic value in a tight loop apparently creates a performance problem that is severe enough for the Swift team to redesign their API. That wasn't decades ago:
"Code that handles indices has to perform atomic reference counting, which has significant overhead and can prevent the optimizer from making other improvements."
https://github.com/apple/swift-evolution/blob/master/proposals/0065-collections-move-indices.md https://github.com/apple/swift-evolution/blob/master/proposa...