Noticed that debug logging takes a bit of CPU during assembly - even if the log is disabled. Turns out, it's because log_debug etc. aren't macros and, therefore, fully evaluate all arguments before forwarding to the logger. If the logger doesn't need to sink the resulting message, then the evaluation is wasted.
Brief summary of changes
Check if the log level is Debug before computing quantities that may appear in a debug log message
Fixes issue N/A
Noticed that debug logging takes a bit of CPU during assembly - even if the log is disabled. Turns out, it's because
log_debug
etc. aren't macros and, therefore, fully evaluate all arguments before forwarding to the logger. If the logger doesn't need to sink the resulting message, then the evaluation is wasted.Brief summary of changes
Debug
before computing quantities that may appear in a debug log messageTesting I've completed
Looking for feedback on...
CHANGELOG.md (choose one)
This change is