Fastest way to sort 10 numbers? (numbers are 32 bit)

I’m solving a problem and it involves sorting 10 numbers (int32) very quickly. My application needs to sort 10 numbers millions of times as fast as possible. I’m sampling a data set of billions of elements and every time I need to pick 10 numbers out of it (simplified) and sort them (and make conclusions … Read more

Fastest sort of fixed length 6 int array

Answering to another Stack Overflow question (this one) I stumbled upon an interesting sub-problem. What is the fastest way to sort an array of 6 integers? As the question is very low level: we can’t assume libraries are available (and the call itself has its cost), only plain C to avoid emptying instruction pipeline (that … Read more