MCPcopy
hub / github.com/RoaringBitmap/roaring / generateRandomBitmap

Function generateRandomBitmap

benchmark_test.go:404–412  ·  view source on GitHub ↗
(b *testing.B, max, terms int)

Source from the content-addressed store, hash-verified

402}
403
404func generateRandomBitmap(b *testing.B, max, terms int) []byte {
405 bitmap := NewBitmap()
406 for i := 0; i < terms; i++ {
407 bitmap.Add(uint32(rand.Intn(max)))
408 }
409 result, err := bitmap.ToBytes()
410 require.NoError(b, err)
411 return result
412}
413
414func BenchmarkChecksum(b *testing.B) {
415 for terms := 1; terms <= (1 << 20); terms *= 2 {

Callers 1

Calls 3

AddMethod · 0.95
ToBytesMethod · 0.95
NewBitmapFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…