实现 PriorityQueue Test Benchmark

This commit is contained in:
2019-04-08 02:11:37 +08:00
parent 09dbba1a88
commit 9e2bdb12dd
9 changed files with 289 additions and 166 deletions

View File

@@ -324,13 +324,13 @@ func TestGet(t *testing.T) {
func TestRemoveAll(t *testing.T) {
ALL:
for c := 0; c < 5000; c++ {
for c := 0; c < 50000; c++ {
tree := New(compare.Int)
gods := avltree.NewWithIntComparator()
var l []int
m := make(map[int]int)
for i := 0; len(l) < 100; i++ {
for i := 0; len(l) < 50; i++ {
v := randomdata.Number(0, 100000)
if _, ok := m[v]; !ok {
m[v] = v
@@ -340,7 +340,7 @@ ALL:
}
}
for i := 0; i < 100; i++ {
for i := 0; i < 50; i++ {
tree.Remove(l[i])
gods.Remove(l[i])
s1 := spew.Sprint(tree.Values())