Skip to content

Instantly share code, notes, and snippets.

@xlab
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save xlab/1e40af2eac8783ce50d1 to your computer and use it in GitHub Desktop.

Select an option

Save xlab/1e40af2eac8783ce50d1 to your computer and use it in GitHub Desktop.
skarademir/naturalsort VS xlab/handysort
Testcase from https://github.com/skarademir/naturalsort/blob/master/naturalsort_test.go
BenchmarkNaturalSort 50000 28738 ns/op
BenchmarkHandySort 3000000 517 ns/op
A real battle-case from https://github.com/xlab/handysort/blob/master/strings_test.go
(10000 random alphanumeric strings)
BenchmarkStringSort 500 2665145 ns/op
BenchmarkHandyStringSort 100 11817051 ns/op
BenchmarkNaturalStringSort 1 1013808894 ns/op
:)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment