2 ms·
Preprocessor-disabled logging (and generally compile-time disabled logging) is free at run-time. The compile-time cost of stripping out preprocessor macros dis
by kbutler 9y ago
Preprocessor-disabled logging (and generally compile-time disabled logging) is free at run-time.
The compile-time cost of stripping out preprocessor macros disabled via #ifdef is close enough to free you'd have a really hard time measuring it - O(n) on number of lines of logging code, with n smaller than the number of lines of actual code for any real scenario, and a very small multiplier.
The "cost" there is in the visual appearance of the source code.