MCPcopy Create free account
hub / github.com/RoaringBitmap/roaring / BenchmarkFromDense

Function BenchmarkFromDense

roaring_test.go:3702–3720  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

3700}
3701
3702func BenchmarkFromDense(b *testing.B) {
3703 testDense(func(name string, rb *Bitmap) {
3704 dense := make([]uint64, rb.DenseSize())
3705 rb.WriteDenseTo(dense)
3706 cp := FromDense(dense, false)
3707
3708 for _, doCopy := range []bool{false, true} {
3709 b.Run(fmt.Sprintf("%s,doCopy=%t", name, doCopy), func(b *testing.B) {
3710 b.ReportAllocs()
3711 b.SetBytes(int64(len(dense) * 8))
3712 b.ResetTimer()
3713 for i := 0; i < b.N; i++ {
3714 cp.FromDense(dense, doCopy)
3715 cp.Clear()
3716 }
3717 })
3718 }
3719 })
3720}
3721
3722func BenchmarkWriteDenseTo(b *testing.B) {
3723 testDense(func(name string, rb *Bitmap) {

Callers

nothing calls this directly

Calls 6

testDenseFunction · 0.85
FromDenseFunction · 0.85
DenseSizeMethod · 0.80
WriteDenseToMethod · 0.80
FromDenseMethod · 0.80
ClearMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…