3 ms·
I wish the term wouldn't exist. I've measured "zero-cost abstraction" that weren't quite so when profiled. What it really means is "if the inlining goes like
by p0nce 10y ago
I wish the term wouldn't exist.
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.
- stymaar 10y agoInrust you can tell the compiler to always inline a given function.[1] 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 https://doc.rust-lang.org/reference.html#inline-attributes