|
|
|
@ -373,7 +373,7 @@ func BenchmarkRWMutexMapGet(b *testing.B) {
|
|
|
|
|
b.StartTimer()
|
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
|
mu.RLock()
|
|
|
|
|
_, _ = m["foo"]
|
|
|
|
|
_ = m["foo"]
|
|
|
|
|
mu.RUnlock()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -388,7 +388,7 @@ func BenchmarkRWMutexInterfaceMapGetStruct(b *testing.B) {
|
|
|
|
|
b.StartTimer()
|
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
|
mu.RLock()
|
|
|
|
|
_, _ = m[s]
|
|
|
|
|
_ = m[s]
|
|
|
|
|
mu.RUnlock()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -402,7 +402,7 @@ func BenchmarkRWMutexInterfaceMapGetString(b *testing.B) {
|
|
|
|
|
b.StartTimer()
|
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
|
mu.RLock()
|
|
|
|
|
_, _ = m["foo"]
|
|
|
|
|
_ = m["foo"]
|
|
|
|
|
mu.RUnlock()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -450,7 +450,7 @@ func BenchmarkRWMutexMapGetConcurrent(b *testing.B) {
|
|
|
|
|
go func() {
|
|
|
|
|
for j := 0; j < each; j++ {
|
|
|
|
|
mu.RLock()
|
|
|
|
|
_, _ = m["foo"]
|
|
|
|
|
_ = m["foo"]
|
|
|
|
|
mu.RUnlock()
|
|
|
|
|
}
|
|
|
|
|
wg.Done()
|
|
|
|
|