Conditional Inlining
The compilation, debugging, and profiling negatives associated with inlining strongly encourage the delay of inlining decisions until late in the development cycle, generally after the bulk of the debugging has been performed. Ideally, inlining decisions will be based on the results of profiling. Most compilers can use compile-line switches to prevent inlining, but in the event yours does not, this is a simple way of building your own compile-line switch.
Sadly, profiling requires a moderate amount of effort on the part of the programmer. It is not the sort of thing where anyone wants to be moving methods back and forth between an inlined state for performance and an outlined state for normal testing. Luckily the preprocessor ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access