Skip to content

Comment on Why is processing a sorted array faster than an unsorted array?parent

Comments

In the answers to the original question, somebody mentioned that gcc will convert branches into conditional moves, but only at -O3. I never use -O3, because it's frequently slower than -O2. In another answer, somebody pointed out that the ternary operator always generates a conditional move, which I never knew.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.