实现 PriorityQueue Test Benchmark
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user