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

Function BenchmarkReadArrayHeader

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

Source from the content-addressed store, hash-verified

290}
291
292func BenchmarkReadArrayHeader(b *testing.B) {
293 sizes := []uint32{0, 1, tuint16, tuint32}
294 data := make([]byte, 0, len(sizes)*5)
295 for _, d := range sizes {
296 data = AppendArrayHeader(data, d)
297 }
298 rd := NewReader(NewEndlessReader(data, b))
299 b.ReportAllocs()
300 b.SetBytes(int64(len(data) / len(sizes)))
301 b.ResetTimer()
302 for i := 0; i < b.N; i++ {
303 rd.ReadArrayHeader()
304 }
305}
306
307func TestReadNil(t *testing.T) {
308 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 4

ReadArrayHeaderMethod · 0.95
AppendArrayHeaderFunction · 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…