You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sorty is a type-specific, fast, efficient, concurrent / parallel sorting
library. It is an innovative QuickSort
implementation, hence in-place and does not require extra memory. You can call:
import"github.com/jfcg/sorty/v2"sorty.SortSlice(native_slice) // []int, []float64, []string etc. in ascending ordersorty.SortLen(len_slice) // []string or [][]T 'by length' in ascending ordersorty.Sort(n, lesswap) // lesswap() based
If you have a pair of Less() and Swap(), then you can trivially write your
lesswap() and sort your generic
collections using multiple CPU cores quickly.
sorty does not yet recognize partially sorted (sub-)slices to sort them faster (like pdqsort).
Benchmarks
See Green tick > QA / Tests > Details. Testing and benchmarks are done with random inputs
via jfcg/rng library.
Testing & Parameter Tuning
Run tests with:
go test -timeout 1h -v
You can tune MaxLen* for your platform/CPU with:
go test -timeout 3h -tags tuneparam
Now you can update MaxLen* in maxc.go and run tests again to see the improvements.
The parameters are already set to give good performance over different CPUs.
Also see Green tick > QA / Tuning > Details.