Пример #1
0
func BenchmarkBPT(b *testing.B) {
	t := bpt.NewTree()
	for i := 0; i < b.N; i++ {
		x := bpt.UUID()
		t.Set(x, x)
	}
}
Пример #2
0
func Benchmark_bpt_Set(b *testing.B) {
	for i := 0; i < b.N; i++ {
		t := bpt.NewTree()
		for i := 0; i < size; i++ {
			t.Set(data[i], data[i])
		}
	}
}
Пример #3
0
func main() {
	//prof := profile.CPUProfile
	prof := profile.MemProfile
	defer profile.Start(prof, profile.ProfilePath(".")).Stop()

	t := bpt.NewTree()
	for i := 0; i < 1000000; i++ {
		x := []byte(fmt.Sprintf("%x", i))
		t.Set(x, x)
	}
	t.Close()
}