Get the latest tech news

Your code is fast – if you're lucky


Recently, while I was working on an optimized Quicksort implementation, I came across a rather interesting quirk. Modern compilers (especially Clang) optimize loops using fast, branch-free instructions - provided you use the right programming style.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Code

Code

Related news:

News photo

Write code like a human will maintain it

News photo

GitHub Copilot: Sorry Dave, I can't do that harmful thing - unless you ask me in code

News photo

Reducing Assumptions, Exploding Your Code