(b *testing.B)
| 822 | } |
| 823 | |
| 824 | func BenchmarkSerializationMid(b *testing.B) { |
| 825 | b.ReportAllocs() |
| 826 | b.StopTimer() |
| 827 | r := rand.New(rand.NewSource(0)) |
| 828 | s := NewBitmap() |
| 829 | sz := 10000000 |
| 830 | initsize := 65000 |
| 831 | for i := 0; i < initsize; i++ { |
| 832 | s.Add(uint32(r.Int31n(int32(sz)))) |
| 833 | } |
| 834 | buf := make([]byte, 0, s.GetSerializedSizeInBytes()) |
| 835 | b.StartTimer() |
| 836 | |
| 837 | for j := 0; j < b.N; j++ { |
| 838 | w := bytes.NewBuffer(buf[:0]) |
| 839 | s.WriteTo(w) |
| 840 | } |
| 841 | } |
| 842 | |
| 843 | func BenchmarkSerializationDense(b *testing.B) { |
| 844 | b.ReportAllocs() |
nothing calls this directly
no test coverage detected
searching dependent graphs…