(b *testing.B)
| 30 | ) |
| 31 | |
| 32 | func BenchmarkZeroCopySource(b *testing.B) { |
| 33 | const N = 12000 |
| 34 | buf := make([]byte, N) |
| 35 | rand.Read(buf) |
| 36 | |
| 37 | for i := 0; i < b.N; i++ { |
| 38 | source := NewZeroCopySource(buf) |
| 39 | for j := 0; j < N/100; j++ { |
| 40 | source.NextUint16() |
| 41 | source.NextByte() |
| 42 | source.NextUint64() |
| 43 | source.NextVarUint() |
| 44 | source.NextBytes(20) |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | } |
| 49 | |
| 50 | func BenchmarkDerserialize(b *testing.B) { |
| 51 | const N = 12000 |
nothing calls this directly
no test coverage detected