Measured - 10M calls take about 50 seconds. I think it's significant overhead for unused functionality.
Using a macro can help get rid of this in release build:
#ifdef _DEBUG
#define LOGMESSAGE( str ) OutputDebugString( str );
#else
#define LOGMESSAGE( str )
#endif
Not only removes the calls, but also the parameters evaluation and the text strings are entirely removed and you'll not see them in the binary file.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…