Inlining – The Ultimate Optimisation
xania.org·1d·
📥Inlining
Preview
Report Post

Written by me, proof-read by an LLM. Details at end.

Sixteen days in, and I’ve been dancing around what many consider the fundamental compiler optimisation: inlining. Not because it’s complicated - quite the opposite! - but because inlining is less interesting for what it does (copy-paste code), and more interesting for what it enables.

Initially inlining was all about avoiding the expense of the call1 itself, but nowadays inlining enables many other optimisations to shine.

We’ve already encountered inlining (though I tried to limit it until now): On day 8 to get the size of a vector, we called its .size() method. I completely glossed over the fact that while size() is a method on std::vector, we don’t see a call in…

Similar Posts

Loading similar posts...