Best sort approach for small data sets I am working with small data sets of N elements, usually with N = 8, 16, or 32 elements; all are positive 64-bit float numbers.  I need to identify the smallest N/2 elements.  It is not required that the smallest N/2 elements be sorted, just that I identify which ones they are from among the group of N.  Each program run must perform this sort up to a billion times, so sort speed improvements could generate useful returns for me.  Right now I am using a simple Quicksort that orders all N elements just to prove out my concept.  

It is quite likely that my data are not randomly distributed, but I am not yet at the point where I can get a handle on that.

Eventually, the grand design is that this will find its way into the real world via an X-code implementation.

Any recommendations as to what my best sorting strategy ought to be?
Here are two ideas. It's hard to say whether they're any good - you'll have to implement them.


Use (randomized or deterministic) QuickSelect in order to find the median, and then find the bottom half with a single scan. 
Use some hard-coded sorting network, e.g. Batcher, bitonic or pairwise. If there is some hardware support for the basic operation of sorting two memory cells, then this can be pretty fast (even though you're not using parallelism). You can also try to come up with your own sorting network that only sorts in your sense - perhaps trimming one of the ones I listed would do.