Przeglądaj źródła

Add Peek() calls to the benchmark for more realism

Evan Huus 11 lat temu
rodzic
commit
11fd258f28
1 zmienionych plików z 2 dodań i 0 usunięć
  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()
 	}
 }