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

Function BenchmarkReadUintWithInt64

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

Source from the content-addressed store, hash-verified

599}
600
601func BenchmarkReadUintWithInt64(b *testing.B) {
602 us := []uint64{0, 1, 10000, uint64(rand.Uint32() * 4)}
603 data := make([]byte, 0, 9*len(us))
604 for _, n := range us {
605 data = AppendUint64(data, n)
606 }
607 rd := NewReader(NewEndlessReader(data, b))
608 b.SetBytes(int64(len(data) / len(us)))
609 b.ReportAllocs()
610 b.ResetTimer()
611 for i := 0; i < b.N; i++ {
612 _, err := rd.ReadInt64()
613 if err != nil {
614 b.Fatal(err)
615 }
616 }
617}
618
619func TestReadUint64(t *testing.T) {
620 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 4

ReadInt64Method · 0.95
AppendUint64Function · 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…