https://github.com/mtchavez/gotrie
Trie in Go with a benchmark vs Go Map
https://github.com/mtchavez/gotrie
Last synced: about 2 months ago
JSON representation
Trie in Go with a benchmark vs Go Map
- Host: GitHub
- URL: https://github.com/mtchavez/gotrie
- Owner: mtchavez
- License: mit
- Created: 2014-02-02T00:17:45.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-02T00:58:44.000Z (over 11 years ago)
- Last Synced: 2025-02-04T15:32:49.111Z (4 months ago)
- Language: Go
- Size: 133 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
gotrie
======Trie in Go with a benchmark vs Go Map
## Benchmark
### Add
Adding keys
```shell
$ go test --bench=.*Add.*
testing: warning: no tests to run
PASS
Benchmark_Add_1000 2000000000 0.01 ns/op
Benchmark_Add_10000 2000000000 0.14 ns/op
Benchmark_Add_100000 1 3190024146 ns/op
Benchmark_Add_1000000 1 47723452295 ns/op
BenchmarkMap_Add_1000 2000000000 0.02 ns/op
BenchmarkMap_Add_10000 2000000000 0.02 ns/op
BenchmarkMap_Add_100000 2000000000 0.03 ns/op
BenchmarkMap_Add_1000000 1000000000 0.55 ns/op
ok github.com/mtchavez/trie 131.854s
```### Find
Finding existing keys
```shell
$ go test --bench=.*Find.*
testing: warning: no tests to run
PASS
Benchmark_Find_1000 2000000000 0.00 ns/op
Benchmark_Find_10000 2000000000 0.01 ns/op
Benchmark_Find_100000 1000000000 0.23 ns/op
Benchmark_Find_1000000 1 6378291857 ns/op
Benchmark_MapFind_1000 2000000000 0.00 ns/op
Benchmark_MapFind_10000 2000000000 0.00 ns/op
Benchmark_MapFind_100000 2000000000 0.00 ns/op
Benchmark_MapFind_1000000 2000000000 0.06 ns/op
ok github.com/mtchavez/trie 102.150s
```