Explorar o código

Add Peek() calls to the benchmark for more realism

Evan Huus %!s(int64=11) %!d(string=hai) anos
pai
achega
11fd258f28
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      queue_test.go

+ 2 - 0
queue_test.go

@@ -105,6 +105,7 @@ func BenchmarkQueueSerial(b *testing.B) {
 		q.Add(nil)
 	}
 	for i := 0; i < b.N; i++ {
+		q.Peek()
 		q.Remove()
 	}
 }
@@ -124,6 +125,7 @@ func BenchmarkQueueTickTock(b *testing.B) {
 	q := New()
 	for i := 0; i < b.N; i++ {
 		q.Add(nil)
+		q.Peek()
 		q.Remove()
 	}
 }