MCPcopy
hub / github.com/tinylib/msgp / BenchmarkReadIntWithUint64

Function BenchmarkReadIntWithUint64

msgp/read_test.go:665–681  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

663}
664
665func BenchmarkReadIntWithUint64(b *testing.B) {
666 is := []int64{0, 1, 65000, rand.Int63()}
667 data := make([]byte, 0, 9*len(is))
668 for _, n := range is {
669 data = AppendInt64(data, n)
670 }
671 rd := NewReader(NewEndlessReader(data, b))
672 b.SetBytes(int64(len(data) / len(is)))
673 b.ReportAllocs()
674 b.ResetTimer()
675 for i := 0; i < b.N; i++ {
676 _, err := rd.ReadUint64()
677 if err != nil {
678 b.Fatal(err)
679 }
680 }
681}
682
683func TestReadBytes(t *testing.T) {
684 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 4

ReadUint64Method · 0.95
AppendInt64Function · 0.85
NewReaderFunction · 0.85
NewEndlessReaderFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…