NanoLog icon indicating copy to clipboard operation
NanoLog copied to clipboard

Comparisson between preprocessor and C++17

Open eucristian opened this issue 6 years ago • 1 comments

Hello,

Could you please update the ReadMe with the expected performance difference(in your opinion) between the pre-processor version and the C++17 one? Thank you very much

eucristian avatar Mar 12 '19 09:03 eucristian

I'll update the README more formally at a later point, but informally, we expect the amortized performance of the two to be pretty much the same. Here "amortized" means you've logged a particular log message more than a few times.

The reason for this difference is that NanoLog C++17 executes additional logic when it encounters a log message it's never seen before. However, this only happens at most once per unique log message statement and the logic is fairly simple (grab a lock and push a pointer on a vector). After that point, the two implementations are nearly identical, so we do not expect their amortized performance to vary very much.

syang0 avatar Mar 15 '19 00:03 syang0