(b *testing.B)
| 581 | } |
| 582 | |
| 583 | func BenchmarkReadInt64(b *testing.B) { |
| 584 | is := []int64{0, 1, 65000, rand.Int63()} |
| 585 | data := make([]byte, 0, 9*len(is)) |
| 586 | for _, n := range is { |
| 587 | data = AppendInt64(data, n) |
| 588 | } |
| 589 | rd := NewReader(NewEndlessReader(data, b)) |
| 590 | b.SetBytes(int64(len(data) / len(is))) |
| 591 | b.ReportAllocs() |
| 592 | b.ResetTimer() |
| 593 | for i := 0; i < b.N; i++ { |
| 594 | _, err := rd.ReadInt64() |
| 595 | if err != nil { |
| 596 | b.Fatal(err) |
| 597 | } |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | func BenchmarkReadUintWithInt64(b *testing.B) { |
| 602 | us := []uint64{0, 1, 10000, uint64(rand.Uint32() * 4)} |
nothing calls this directly
no test coverage detected
searching dependent graphs…