goleveldb icon indicating copy to clipboard operation
goleveldb copied to clipboard

remove unused mutex

Open ngaut opened this issue 6 years ago • 1 comments
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

ngaut avatar Feb 12 '19 08:02 ngaut

@tiancaiamao PTAL

coocood avatar Feb 12 '19 09:02 coocood