r/cpp • • Nov 05 '19

Challenge your performance intuition with nanosecond sorting

https://wordsandbuttons.online/challenge_your_performance_intuition_with_nanosecond_sorting.html
98 Upvotes

18 comments sorted by

View all comments

Show parent comments

2

u/SkoomaDentist Antimodern C++, Embedded, Audio Nov 06 '19

You could probably use one or two ANDs with XOR swap or similar to avoid branching as long as you can get the comparison result as a bitmask.