AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
The Problem With Three Way Comparisons
The three way comparison is just slow because on the low level, if you're doing it based on branches, there are like instructions where you can like compute an address and then immediately jump to it at address. And especially when you start doing branchless stuff, where you are using this instruction called CMOS conditional move,. It's all done in one instruction without any branches. All that stuff is binary, the fast of is binary. There's an in place technique where you essentially you find an element on the left that should go on the right and you swap the two. That's another approach but now you're doing two passes over it, right? Like you have to know where the data