Skip to content

[Debug.hpp] wrap actual logging in log-level constexpr

Florian Fischer requested to merge aj46ezos/emper:cleanup-debug5 into master

According to godbolt.org

do { if constexpr(false) { break; } int foo = 42; foo++; } while(false);

does result in code generation for gcc 10.2 and clang 11.0.1 as opposed to

do { if constexpr(false) { int foo = 42; foo++; }} while(false);

which does not result in code generation for both gcc and clang.

And this simple change did indeed significantly increases our echo benchmark performance. We were probably creating a lot of std::stringstream objects without ever using them.

Merge request reports

Loading