sm
/
cache
1
0
Fork 0

Change the names of the MutexMap benchmarks to RWMutex to clarify the changes to the map benchmarks and the cache itself

This commit is contained in:
Patrick Mylund Nielsen 2013-06-30 20:40:26 -04:00
parent 155ab21e5d
commit 2fb27e8369
1 changed files with 8 additions and 8 deletions

View File

@ -1384,7 +1384,7 @@ func BenchmarkCacheGet(b *testing.B) {
} }
} }
func BenchmarkMutexMapGet(b *testing.B) { func BenchmarkRWMutexMapGet(b *testing.B) {
b.StopTimer() b.StopTimer()
m := map[string]string{ m := map[string]string{
"foo": "bar", "foo": "bar",
@ -1418,7 +1418,7 @@ func BenchmarkCacheGetConcurrent(b *testing.B) {
wg.Wait() wg.Wait()
} }
func BenchmarkMutexMapGetConcurrent(b *testing.B) { func BenchmarkRWMutexMapGetConcurrent(b *testing.B) {
b.StopTimer() b.StopTimer()
m := map[string]string{ m := map[string]string{
"foo": "bar", "foo": "bar",
@ -1503,10 +1503,10 @@ func BenchmarkCacheSet(b *testing.B) {
} }
} }
func BenchmarkMutexMapSet(b *testing.B) { func BenchmarkRWMutexMapSet(b *testing.B) {
b.StopTimer() b.StopTimer()
m := map[string]string{} m := map[string]string{}
mu := sync.Mutex{} mu := sync.RWMutex{}
b.StartTimer() b.StartTimer()
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
mu.Lock() mu.Lock()
@ -1525,10 +1525,10 @@ func BenchmarkCacheSetDelete(b *testing.B) {
} }
} }
func BenchmarkMutexMapSetDelete(b *testing.B) { func BenchmarkRWMutexMapSetDelete(b *testing.B) {
b.StopTimer() b.StopTimer()
m := map[string]string{} m := map[string]string{}
mu := sync.Mutex{} mu := sync.RWMutex{}
b.StartTimer() b.StartTimer()
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
mu.Lock() mu.Lock()
@ -1552,10 +1552,10 @@ func BenchmarkCacheSetDeleteSingleLock(b *testing.B) {
} }
} }
func BenchmarkMutexMapSetDeleteSingleLock(b *testing.B) { func BenchmarkRWMutexMapSetDeleteSingleLock(b *testing.B) {
b.StopTimer() b.StopTimer()
m := map[string]string{} m := map[string]string{}
mu := sync.Mutex{} mu := sync.RWMutex{}
b.StartTimer() b.StartTimer()
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
mu.Lock() mu.Lock()