(b *testing.B)
| 107 | } |
| 108 | |
| 109 | func 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 | |
| 125 | func TestCompressedCount(t *testing.T) { |
| 126 | ba := newSparseBitArray() |
nothing calls this directly
no test coverage detected
searching dependent graphs…