MCPcopy
hub / github.com/Workiva/go-datastructures / BenchmarkGetSetCompressedBits

Function BenchmarkGetSetCompressedBits

bitarray/sparse_bitarray_test.go:109–123  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

107}
108
109func BenchmarkGetSetCompressedBits(b *testing.B) {
110 ba := newSparseBitArray()
111 for i := uint64(0); i < 168000; i++ {
112 if i%13 == 0 || i%5 == 0 {
113 require.NoError(b, ba.SetBit(i))
114 }
115 }
116
117 buf := make([]uint64, 0, ba.Capacity())
118
119 b.ResetTimer()
120 for i := 0; i < b.N; i++ {
121 ba.GetSetBits(0, buf)
122 }
123}
124
125func TestCompressedCount(t *testing.T) {
126 ba := newSparseBitArray()

Callers

nothing calls this directly

Calls 4

newSparseBitArrayFunction · 0.85
SetBitMethod · 0.65
CapacityMethod · 0.65
GetSetBitsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…