Add benchmark

This commit is contained in:
Richard Artoul 2018-11-29 20:45:26 -05:00
parent 6d021fe870
commit 42e756b316

View file

@ -3267,6 +3267,27 @@ func TestUnmarshalOfficialRoaring(t *testing.T) {
}
func BenchmarkUnionBitmapBitmapInPlace(b *testing.B) {
b1 := newTestBitmapContainer()
b2 := newTestBitmapContainer()
for n := 0; n < b.N; n++ {
unionBitmapBitmapInPlace(b1, b2)
}
}
func newTestBitmapContainer() *Container {
var (
buf = make([]uint64, bitmapN)
ob = buf[:bitmapN]
container = &Container{
bitmap: ob,
n: 0,
containerType: containerBitmap,
}
)
return container
}
/*
// This function exercises an arcane edge case in dead code.
// It doesn't need to be run right now.