5 ms·
Right, inlines are hard to beat, and they are not part of the C standard (which is kind of mind boggling, I mean . . . honestly, what year is it?). Still, the
by kabdib 7y ago
Right, inlines are hard to beat, and they are not part of the C standard (which is kind of mind boggling, I mean . . . honestly, what year is it?).
Still, the benefit of inlines diminishes as the size of the inlined functions increases (you start paying penalties for extra cache lines full of code, and the percentage of time in function call overhead gets small in a hurry).
The linker can get into the inlining game, too, by the way, if the win is sufficiently big. I have scars to prove it. :-)
- colonwqbang 7y agoWhat do you mean by "inlines are not part of the C standard"? The standard talks about visible behaviour of programs, never the concrete implementation.
- kabdib 7y agoYou're correct about C99. I cut my teeth on K&R; C99 has inline declarations.