Simplicial interpolation with sorting network

Interesting links, thanks. In practice, it often does not really matter whether it runs slightly faster or not… But it is fun to dive into these details. Anyway here are some further numbers (only gfortran with large sets):

Sorting many shuffled arrays of size 100 yields a 10% improvement with the minmax variant over swap variant.

Sorting many shuffled arrays of size 8 directly with a sorting network gives a 85% (factor ca. 7) improvement with minmax.

Thus regarding the original question where sorting of small arrays is required, it looks like that a conditional-jump-free version provided by a sorting network can make a huge difference.

3 Likes