| 1 |
package proto |
| 2 |
|
| 3 |
import "testing" |
| 4 |
|
| 5 |
func BenchmarkIsZeroBytes0(b *testing.B) { |
| 6 |
benchmarkIsZeroBytes(b, nil) |
| 7 |
} |
| 8 |
|
| 9 |
func BenchmarkIsZeroBytes4(b *testing.B) { |
| 10 |
benchmarkIsZeroBytes(b, make([]byte, 4)) |
| 11 |
} |
| 12 |
|
| 13 |
func BenchmarkIsZeroBytes7(b *testing.B) { |
| 14 |
benchmarkIsZeroBytes(b, make([]byte, 7)) |
| 15 |
} |
| 16 |
|
| 17 |
func BenchmarkIsZeroBytes64K(b *testing.B) { |
| 18 |
benchmarkIsZeroBytes(b, make([]byte, 64*1024)) |
| 19 |
} |
| 20 |
|
| 21 |
func benchmarkIsZeroBytes(b *testing.B, slice []byte) { |
| 22 |
for range b.N { |
| 23 |
isZeroBytes(slice) |
| 24 |
} |
| 25 |
} |