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

Function benchappendBytes

msgp/write_bytes_test.go:330–339  ·  view source on GitHub ↗
(size uint32, b *testing.B)

Source from the content-addressed store, hash-verified

328}
329
330func benchappendBytes(size uint32, b *testing.B) {
331 bts := RandBytes(int(size))
332 buf := make([]byte, 0, len(bts)+5)
333 b.SetBytes(int64(len(bts) + 5))
334 b.ReportAllocs()
335 b.ResetTimer()
336 for i := 0; i < b.N; i++ {
337 AppendBytes(buf[0:0], bts)
338 }
339}
340
341func BenchmarkAppend16Bytes(b *testing.B) { benchappendBytes(16, b) }
342

Callers 3

BenchmarkAppend16BytesFunction · 0.85
BenchmarkAppend256BytesFunction · 0.85
BenchmarkAppend2048BytesFunction · 0.85

Calls 2

RandBytesFunction · 0.85
AppendBytesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…