4 ms·
Executable bloat can be avoided by stripping the executable afterwards, if that's what you mean: Although the function body will have been provided if instantia
by mhh__ 7y ago
Executable bloat can be avoided by stripping the executable afterwards, if that's what you mean: Although the function body will have been provided if instantiated and used, the compiler will have probably inlined a huge amount of any code that is actually used - a lot of templated stuff is made up of one liners or single uses, which compilers are very very good about reasoning through the motion of these days.
I guess a naive compiler could have issues but every time I check something on compiler explorer, the modern big boys (GCC, LLVM, ICC?) are pretty shrewd (Especially if you optimise for size).
- cbetti 7y agoWhile aggressive inlining eliminates function call overhead, it can actually exacerbate instruction cache misses because it makes the executable larger.