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

Function BenchmarkReadMapHeader

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

Source from the content-addressed store, hash-verified

240}
241
242func BenchmarkReadMapHeader(b *testing.B) {
243 sizes := []uint32{0, 1, tuint16, tuint32}
244 data := make([]byte, 0, len(sizes)*5)
245 for _, d := range sizes {
246 data = AppendMapHeader(data, d)
247 }
248 rd := NewReader(NewEndlessReader(data, b))
249 b.SetBytes(int64(len(data) / len(sizes)))
250 b.ReportAllocs()
251 b.ResetTimer()
252 for i := 0; i < b.N; i++ {
253 rd.ReadMapHeader()
254 }
255}
256
257func TestReadArrayHeader(t *testing.T) {
258 tests := []struct {

Callers

nothing calls this directly

Calls 4

ReadMapHeaderMethod · 0.95
AppendMapHeaderFunction · 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…