4 ms·
It might be easier for SIMD to work by extracting the key value from each object into its own array. Form an array with fixed element size: [ {index0 | key0},
by ww520 4y ago
It might be easier for SIMD to work by extracting the key value from each object into its own array.
Form an array with fixed element size: [ {index0 | key0}, {index1 | key1}, ...], where indices are the element index to the original array of objects and the keys are fixed size. The fat element {index | key} is moved as a whole unit to carry the original index along with the swap during sorting. SIMD can deal with fixed size units very well.
- nickelpro 4y agoThat would be called a gather operation, which is itself slow, exactly as the OP comment said.