diff options
Diffstat (limited to 'libgo/go/container/heap/heap_test.go')
-rw-r--r-- | libgo/go/container/heap/heap_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libgo/go/container/heap/heap_test.go b/libgo/go/container/heap/heap_test.go index cb31ef6d30a..73f33e8d2cf 100644 --- a/libgo/go/container/heap/heap_test.go +++ b/libgo/go/container/heap/heap_test.go @@ -170,3 +170,16 @@ func TestRemove2(t *testing.T) { } } } + +func BenchmarkDup(b *testing.B) { + const n = 10000 + h := make(myHeap, n) + for i := 0; i < b.N; i++ { + for j := 0; j < n; j++ { + Push(&h, 0) // all elements are the same + } + for h.Len() > 0 { + Pop(&h) + } + } +} |