https://github.com/alextanhongpin/go-heapsort
A naive implementation of HeapSort in Go
https://github.com/alextanhongpin/go-heapsort
benchmark golang heapsort
Last synced: 8 months ago
JSON representation
A naive implementation of HeapSort in Go
- Host: GitHub
- URL: https://github.com/alextanhongpin/go-heapsort
- Owner: alextanhongpin
- Created: 2018-06-02T14:58:14.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-02T14:58:38.000Z (about 8 years ago)
- Last Synced: 2025-01-29T21:54:19.956Z (over 1 year ago)
- Topics: benchmark, golang, heapsort
- Language: Go
- Size: 1000 Bytes
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# heapsort
A naive heapsort implementation in golang, to test the performance against the standard `sort` package.
## Benchmark
```
$ go test -bench=. -benchmem
```
Output:
```bash
goos: darwin
goarch: amd64
pkg: github.com/alextanhongpin/go-heapsort
BenchmarkHeapSort-4 20000000 98.0 ns/op 0 B/op 0 allocs/op
BenchmarkSortInt-4 10000000 168 ns/op 80 B/op 2 allocs/op
BenchmarkHeapSortItem-4 20000000 97.3 ns/op 0 B/op 0 allocs/op
BenchmarkSortSliceStable-4 3000000 420 ns/op 256 B/op 4 allocs/op
PASS
```