Skip to content
Snippets Groups Projects
Commit c6c82bb4 authored by Manuel Kieweg's avatar Manuel Kieweg
Browse files

change benchmark order

parent 8d693d0b
No related branches found
No related tags found
No related merge requests found
Pipeline #81068 passed with warnings
...@@ -115,7 +115,7 @@ func BenchmarkAddGet(b *testing.B) { ...@@ -115,7 +115,7 @@ func BenchmarkAddGet(b *testing.B) {
} }
} }
func BenchmarkGetParallel(b *testing.B) { func BenchmarkAddParallel(b *testing.B) {
if testing.Short() { if testing.Short() {
b.Skip("skipping parallel tests in short mode") b.Skip("skipping parallel tests in short mode")
} }
...@@ -166,14 +166,17 @@ func BenchmarkGetParallel(b *testing.B) { ...@@ -166,14 +166,17 @@ func BenchmarkGetParallel(b *testing.B) {
b.SetParallelism(bm.iterations) b.SetParallelism(bm.iterations)
b.RunParallel(func(pb *testing.PB) { b.RunParallel(func(pb *testing.PB) {
for pb.Next() { for pb.Next() {
bm.s.Get(uuid.Nil) b.StopTimer()
item := &testItem{id: uuid.New()}
b.StartTimer()
bm.s.Add(item)
} }
}) })
}) })
} }
} }
func BenchmarkAddParallel(b *testing.B) { func BenchmarkGetParallel(b *testing.B) {
if testing.Short() { if testing.Short() {
b.Skip("skipping parallel tests in short mode") b.Skip("skipping parallel tests in short mode")
} }
...@@ -224,10 +227,7 @@ func BenchmarkAddParallel(b *testing.B) { ...@@ -224,10 +227,7 @@ func BenchmarkAddParallel(b *testing.B) {
b.SetParallelism(bm.iterations) b.SetParallelism(bm.iterations)
b.RunParallel(func(pb *testing.PB) { b.RunParallel(func(pb *testing.PB) {
for pb.Next() { for pb.Next() {
b.StopTimer() bm.s.Get(uuid.Nil)
item := &testItem{id: uuid.New()}
b.StartTimer()
bm.s.Add(item)
} }
}) })
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment