pmylund/go-cache — pull request #13 by t0pep0 (2014-06-27 12:43:00+00:00)
Title: Change map[string]interface{} to binary tree

map[string]interface{} benchmark:
===========================
```
dtlbox-ubuntu1@~/Work/gosource/src/github.com/pmylund/go-cache$ go test -bench=".*"
PASS
BenchmarkCacheGet	50000000	48.3 ns/op
BenchmarkRWMutexMapGet	50000000	37.5 ns/op
BenchmarkCacheGetConcurrent	50000000	47.9 ns/op
BenchmarkRWMutexMapGetConcurrent	50000000	35.4 ns/op
BenchmarkCacheGetManyConcurrent	50000000	48.5 ns/op
BenchmarkShardedCacheGetManyConcurrent	5000000	423 ns/op
BenchmarkCacheSet	5000000	382 ns/op
BenchmarkRWMutexMapSet	20000000	109 ns/op
BenchmarkCacheSetDelete	5000000	523 ns/op
BenchmarkRWMutexMapSetDelete	10000000	240 ns/op
BenchmarkCacheSetDeleteSingleLock	5000000	449 ns/op
BenchmarkRWMutexMapSetDeleteSingleLock	10000000	191 ns/op
ok	github.com/pmylund/go-cache	29.174s
````
binary tree benchmark
==================
```
dtlbox-ubuntu1@~/Work/gosource/src/github.com/t0pep0/go-cache$ go test -bench=".*"
PASS
BenchmarkCacheGet	50000000	52.5 ns/op
BenchmarkRWMutexMapGet	50000000	45.9 ns/op
BenchmarkCacheGetConcurrent	50000000	45.3 ns/op
BenchmarkRWMutexMapGetConcurrent	50000000	34.8 ns/op
BenchmarkCacheGetManyConcurrent	50000000	51.2 ns/op
BenchmarkShardedCacheGetManyConcurrent	5000000	380 ns/op
BenchmarkCacheSet	10000000	166 ns/op
BenchmarkRWMutexMapSet	20000000	114 ns/op
BenchmarkCacheSetDelete	10000000	279 ns/op
BenchmarkRWMutexMapSetDelete	10000000	284 ns/op
BenchmarkCacheSetDeleteSingleLock	10000000	178 ns/op
BenchmarkRWMutexMapSetDeleteSingleLock	10000000	187 ns/op
ok	github.com/t0pep0/go-cache	29.163s
```