MCPcopy Index your code
hub / github.com/google/gvisor / BenchmarkWriteRead

Function BenchmarkWriteRead

pkg/buffer/buffer_test.go:43–54  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

41}
42
43func BenchmarkWriteRead(b *testing.B) {
44 b.ReportAllocs()
45 var buf Buffer
46 defer buf.Release()
47 sz := 1000
48 rbuf := bytes.NewBuffer(make([]byte, sz))
49 for i := 0; i < b.N; i++ {
50 buf.Append(NewView(sz))
51 rbuf.Reset()
52 buf.ReadToWriter(rbuf, int64(sz))
53 }
54}
55
56func fillAppend(b *Buffer, data []byte) {
57 b.Append(NewViewWithData(data))

Callers

nothing calls this directly

Calls 5

ReleaseMethod · 0.95
AppendMethod · 0.95
ReadToWriterMethod · 0.95
NewViewFunction · 0.70
ResetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…