https://github.com/everlag/goradix
Naive LSB Radix sort in golang
https://github.com/everlag/goradix
Last synced: 10 months ago
JSON representation
Naive LSB Radix sort in golang
- Host: GitHub
- URL: https://github.com/everlag/goradix
- Owner: Everlag
- Created: 2015-07-27T19:21:53.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-07-27T19:25:16.000Z (almost 11 years ago)
- Last Synced: 2025-02-22T00:25:06.185Z (over 1 year ago)
- Language: Go
- Size: 97.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
A simple example of LSB(Least Significant Bit) Radix sort in go.
Interestingly, we are within 75% of the std sort for massive slices but fall to 50% as fast for smaller slices.
Possible extensions could be adding SIMD via go's support for asm or switching to MSB sort and dividing work among available cpus.
This naive implementation benches as follows on a i5-2500k at stock clock, the standard 'sort' package is provided for comparison.
BenchmarkIntsBig 3 454724400 ns/op
BenchmarkStdBig 5 313639820 ns/op
BenchmarkIntsSmall 5000 371447 ns/op
BenchmarkStdSmall 10000 153469 ns/op