Re:App Developers on Swift Evolution
by mpweiher on Wednesday December 23, 2015 @06:25PM
(#10786271)
The chart is wrong for message sends. I've been measuring this for a long time, and get ~2.1ns for a message send vs. 1.2ns for a cached message send on a comparable machine.
If you want inlining, use a static inline function.
But it's even worse than that: I'm talking about devirtualized calls, which are far faster than virtual calls in C++. More importantly than just the call time, devirtualization can have outsized performance impact because it enables inlining, converting intraprocedural optimizations to interprocedural optimizations. The difference between inlining and not can easily be a 10x-level performance difference with an optimizing compiler like LLVM.