소스 검색

Add Peek() calls to the benchmark for more realism

Evan Huus 11 년 전
부모
커밋
11fd258f28
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  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()
 	}
 }