fix: prefer std::nearbyint over std::round to avoid gcc 10 perf regression
What a nice
Especially since I could have saved a lot of time if only I remembered !1856 (merged)
We really should be adding std::round
to the list of things we should flag in code review.
Local tests show a slight difference in counters, which is expected as the rounding behavior is a bit different.
Why didn't we run into this problem with gcc9 ?! Well, I can't find a single mention of round
when looking at the .so
with objdump
.
No idea what smart tricks gcc9 played, but the .so
from gcc10 had the round
functions, so that's why we started paying for them.