News for hackers. Stuff that matters.
Re:Apple CPU tricks: memory reordering, JavaScript support, ... by zozbot234 on Friday November 27, 2020 @07:08PM (#25233784)
Refcounting in a single-threaded context is extremely quick and efficient. What's expensive is atomic reference counting, as seen e.g. in C++ shared_ptr<> and Swift ARC.
Re:Apple CPU tricks: memory reordering, JavaScript support, ... by vlovich123 on Friday November 27, 2020 @10:55PM (#25235130)
Interestingly the Twitter thread is saying uncontended atomic operations are generally as fast as non-atomic, so I don’t think the weaker memory model is the totality of the reason.

Another thing is apparently their branch predictor is specially tuned to work with how Objective-c dispatch works (which iirc Swift inherits in places too, and not just when interfacing with Obj-C APIs)