MCPcopy Index your code
hub / github.com/tinylib/msgp / BenchmarkReadMapHeaderBytes

Function BenchmarkReadMapHeaderBytes

msgp/read_bytes_test.go:39–55  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

37}
38
39func BenchmarkReadMapHeaderBytes(b *testing.B) {
40 sizes := []uint32{1, 100, tuint16, tuint32}
41 buf := make([]byte, 0, 5*len(sizes))
42 for _, sz := range sizes {
43 buf = AppendMapHeader(buf, sz)
44 }
45 b.SetBytes(int64(len(buf) / len(sizes)))
46 b.ReportAllocs()
47 b.ResetTimer()
48 o := buf
49 for i := 0; i < b.N; i++ {
50 _, buf, _ = ReadMapHeaderBytes(buf)
51 if len(buf) == 0 {
52 buf = o
53 }
54 }
55}
56
57func TestReadArrayHeaderBytes(t *testing.T) {
58 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 2

AppendMapHeaderFunction · 0.85
ReadMapHeaderBytesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…