I suggest just a fDebug check there.
If any kind of debugging is enabled, performance becomes less of an issue.