MCPcopy Create free account
hub / github.com/valyala/bytebufferpool / BenchmarkBytesBufferWrite

Function BenchmarkBytesBufferWrite

bytebuffer_timing_test.go:21–32  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

19}
20
21func BenchmarkBytesBufferWrite(b *testing.B) {
22 s := []byte("foobarbaz")
23 b.RunParallel(func(pb *testing.PB) {
24 var buf bytes.Buffer
25 for pb.Next() {
26 for i := 0; i < 100; i++ {
27 buf.Write(s)
28 }
29 buf.Reset()
30 }
31 })
32}

Callers

nothing calls this directly

Calls 2

WriteMethod · 0.80
ResetMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…