2
0

Don't use defer for mutex unlocking (it currently adds ~200ns)

This commit is contained in:
Patrick Mylund Nielsen
2012-02-17 01:40:55 +01:00
parent 13b338b204
commit 91bd4334f1
2 changed files with 17 additions and 18 deletions
+1 -1
View File
@@ -675,11 +675,11 @@ func BenchmarkCacheSetDelete(b *testing.B) {
func BenchmarkCacheSetDeleteSingleLock(b *testing.B) {
tc := New(0, 0)
tc.mu.Lock()
defer tc.mu.Unlock()
for i := 0; i < b.N; i++ {
tc.set("foo", "bar", 0)
tc.delete("foo")
}
tc.mu.Unlock()
}
func BenchmarkMapSetDelete(b *testing.B) {