(b *testing.B)
| 841 | } |
| 842 | |
| 843 | func BenchmarkSerializationDense(b *testing.B) { |
| 844 | b.ReportAllocs() |
| 845 | b.StopTimer() |
| 846 | r := rand.New(rand.NewSource(0)) |
| 847 | s := NewBitmap() |
| 848 | sz := 150000 |
| 849 | initsize := 65000 |
| 850 | for i := 0; i < initsize; i++ { |
| 851 | s.Add(uint32(r.Int31n(int32(sz)))) |
| 852 | } |
| 853 | buf := make([]byte, 0, s.GetSerializedSizeInBytes()) |
| 854 | b.StartTimer() |
| 855 | |
| 856 | for j := 0; j < b.N; j++ { |
| 857 | w := bytes.NewBuffer(buf[:0]) |
| 858 | s.WriteTo(w) |
| 859 | } |
| 860 | } |
| 861 | |
| 862 | func BenchmarkMarshalBinary(b *testing.B) { |
| 863 | r := rand.New(rand.NewSource(0)) |
nothing calls this directly
no test coverage detected
searching dependent graphs…