by zimbatm · 9y ago · 0 comments
I've measured "zero-cost abstraction" that weren't quite so when profiled.
What it really means is "if the inlining goes like the programmer expects, then it should have no cost". The term expresses hope.
But inlining is best left to the compiler, and hope is of little value until measurement is done with a profiler.
But you don't necessarily want to do that since you may not make the most efficient use of the CPU cache.
[1] https://doc.rust-lang.org/reference.html#inline-attributes