Skip to content

Comment on Branchless Lomuto Partitioningparent

Comments

Doesn't the comparison have to be inlined, and tiny, not to mention itself branchless?

Yes.

This generally means floats and integers, or small combinations thereof. Note that this is after projection of the comparison operator, so things can remain branchless when sorting e.g. strings by length.

The inlining generally isn't an issue in languages like C++ and Rust.

Forget string keys.

You can sort string keys (mostly) branchlessly with radix sorting, but yes for comparison sorting you can forget it.

AboutSource Built by g1lg1l

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