segmentio / asm

Go library providing algorithms optimized to leverage the characteristics of modern CPUs
MIT No Attribution
869 stars 36 forks source link

use branchless bubble sort for small arrays #32

Closed achille-roussel closed 3 years ago

achille-roussel commented 3 years ago

Getting some nice early results on this change:

name        old time/op   new time/op   delta
Sort8/1000   14.5µs ± 7%   10.5µs ± 5%  -27.58%  (p=0.000 n=10+9)

name        old speed     new speed     delta
Sort8/1000  552MB/s ± 7%  762MB/s ± 5%  +37.97%  (p=0.000 n=10+9)