Hacker News new | ask | show | jobs
by ridiculous_fish 1716 days ago
I would expect the switch implementation to not emit any branches. Example:

https://godbolt.org/z/Gox7nYfxP

So it is surprising that OP saw branch mispredictions. What compiler and flags were used?