Iâve always believed that measuring performance, publishing results , and publishing a plan to address results is a straightforward way to get real work done.
You will notice thatâs what I sent.
Ive found the replies have been mostly conjecture and emotional defensiveness instead of analysis.
One of the things we do for a big performance gain is override the debug hooks for retain/release and have a special class type that writes a value into a data member on the swift side that tells our hooks to ignore all retain release calls.
For âstatic let instances â and other permanent objects itâs a BIG win (no atomics)- but obviously the compiler is still spraying function calls on top of most swift object ptr dereferences - you could imagine someone looking into that motif and getting our win plus the less function calling for everyone.
Imagine a type that the compiler can see that just says âno arcâ. That could be a sendable kind of decoration on the swift side, that changes the type in a way the compiler sees that causes a codegen change.
Or it could be that the compiler sniffs out the use case and annotates then. Any language teams job is to give library writers the tools to write performant code safely. There's a set of idioms here that are ALOT safer than Unsafe. And give us some turbo.
We did this work because instruments clearly shows retain / release as a huge cost. So we analyzed, and then planned an attack. And got the win. The key thing with performance is to change the behavior of the code and remeasure- Atomics and other things that causes pipeline behavior changes in modern CPU's tend to have downstream performance costs that are best measured with A/B testing, not just spot looking at profiles.
I donât see a lot of even acknowledgement that retain / release dominates cpu bound profiles in many cases? You know how they say admitting a problem is the first step..
In our data , It is clear that for cpu bound stuff itâs a bigger win than going to apple silicon - seems likes itâs worth a look.
Love swift and hope one day its performance catches up to rust and c++. Itâs got python beat , and thatâs truly inspiring.
