Got the idea to try implementing Python's deque in Go. The C implementation is pretty easy to read. The result is deque for Go, which implement a subset of the features from Python's deque but enough for our needs. And it's pretty fast too:
$ make compare Git head is 765f6b0 cd compare && go test -run NONE -bench . -v testing: warning: no tests to run PASS BenchmarkHistAppend-4 3000000 517 ns/op BenchmarkHistList-4 2000000 702 ns/op BenchmarkHistQueue-4 3000000 576 ns/op BenchmarkHistDeque-4 3000000 423 ns/op ok _/home/miki/Projects/go/src/github.com/tebeka/deque/compare 8.505s
No comments:
Post a Comment