goleveldb
goleveldb copied to clipboard
remove unused mutex
trafficstars
Currently, the only component of goleveldb that tidb depends on is memdb, and tidb is using it in a single thread/goroutine, there is no need to use mutex. Not sure if i am right.
Here is the benchmark:
with mutex: BenchmarkPut-12 961 ns/op BenchmarkPutRandom-12 1506 ns/op BenchmarkGet-12 1038 ns/op BenchmarkGetRandom-12 2009 ns/op
after removed mutex: BenchmarkPut-12 891 ns/op BenchmarkPutRandom-12 1516 ns/op BenchmarkGet-12 993 ns/op BenchmarkGetRandom-12 2017 ns/op
@tiancaiamao PTAL