Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Bitonic sort has a couple of properties that make it poor fit for a generic sorting algorithm:

* The number of items being sorted must be a power of 2 (2^n).

* The number of comparisons it makes is larger than other sorting algorithms like merge sort, which will make it slower in non-parallel environments in many cases.

Bitonic sort has the advantage that it can be implemented to run in highly parallel environments (hardware, FPGAs, etc.), where the cost of comparisons is offset by them operating in parallel, so the sort completes faster even though more comparisons are occurring.



bitonic sort is O(n log(n)^2), which hardly makes a difference in normal sizes (benchmarks are on 10k, which is small).

The power of 2 requirement only applies to the core kernel.

All CPUs in usage today are parallel (in 3 to 4 different ways), and bitonic sort is the best performing sort on both amd64 and aarch64.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: