Swift Performance

There are some limited optimizations to turn refcounts into nonatomic operations when we know the object being referenced doesn't escape to other threads, but it's difficult to do much of that today because Swift as a whole does not have a strong notion of threads. However, recent Apple Silicon hardware, like the A14 CPU in the latest iPhones and iPads, new makes uncontended atomic operations almost as cheap as nonatomic accesses, making that kind of compile-time optimization less necessary.

7 Likes