update benchmark

This commit is contained in:
Josh Baker 2017-04-01 09:18:40 -07:00
parent 6008a78281
commit 16d0de422b
1 changed files with 7 additions and 9 deletions

View File

@ -108,17 +108,15 @@ func TestKNN(t *testing.T) {
}
func BenchmarkInsert(b *testing.B) {
var rects []*Rect
for i := 0; i < b.N; i++ {
rects = append(rects, wp(randMinMax()))
}
rand.Seed(0)
b.ReportAllocs()
b.ResetTimer()
tr := New()
for i := 0; i < b.N; i++ {
min, max := randMinMax()
tr.Insert(wp(min, max))
tr.Insert(rects[i])
}
// count := 0
// tr.Search([]float64{-116, 32, 20}, []float64{-114, 34, 800}, func(id int) bool {
// count++
// return true
// })
// println(count)
// //println(tr.Count())
}