From 2fb27e83698cad5b5ef9a7f884f50ea621de2437 Mon Sep 17 00:00:00 2001 From: Patrick Mylund Nielsen Date: Sun, 30 Jun 2013 20:40:26 -0400 Subject: [PATCH] Change the names of the MutexMap benchmarks to RWMutex to clarify the changes to the map benchmarks and the cache itself --- cache_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cache_test.go b/cache_test.go index 380323e..09980a6 100644 --- a/cache_test.go +++ b/cache_test.go @@ -1384,7 +1384,7 @@ func BenchmarkCacheGet(b *testing.B) { } } -func BenchmarkMutexMapGet(b *testing.B) { +func BenchmarkRWMutexMapGet(b *testing.B) { b.StopTimer() m := map[string]string{ "foo": "bar", @@ -1418,7 +1418,7 @@ func BenchmarkCacheGetConcurrent(b *testing.B) { wg.Wait() } -func BenchmarkMutexMapGetConcurrent(b *testing.B) { +func BenchmarkRWMutexMapGetConcurrent(b *testing.B) { b.StopTimer() m := map[string]string{ "foo": "bar", @@ -1503,10 +1503,10 @@ func BenchmarkCacheSet(b *testing.B) { } } -func BenchmarkMutexMapSet(b *testing.B) { +func BenchmarkRWMutexMapSet(b *testing.B) { b.StopTimer() m := map[string]string{} - mu := sync.Mutex{} + mu := sync.RWMutex{} b.StartTimer() for i := 0; i < b.N; i++ { mu.Lock() @@ -1525,10 +1525,10 @@ func BenchmarkCacheSetDelete(b *testing.B) { } } -func BenchmarkMutexMapSetDelete(b *testing.B) { +func BenchmarkRWMutexMapSetDelete(b *testing.B) { b.StopTimer() m := map[string]string{} - mu := sync.Mutex{} + mu := sync.RWMutex{} b.StartTimer() for i := 0; i < b.N; i++ { mu.Lock() @@ -1552,10 +1552,10 @@ func BenchmarkCacheSetDeleteSingleLock(b *testing.B) { } } -func BenchmarkMutexMapSetDeleteSingleLock(b *testing.B) { +func BenchmarkRWMutexMapSetDeleteSingleLock(b *testing.B) { b.StopTimer() m := map[string]string{} - mu := sync.Mutex{} + mu := sync.RWMutex{} b.StartTimer() for i := 0; i < b.N; i++ { mu.Lock()