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

Function BenchmarkByteBufferWrite

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

Source from the content-addressed store, hash-verified

6)
7
8func BenchmarkByteBufferWrite(b *testing.B) {
9 s := []byte("foobarbaz")
10 b.RunParallel(func(pb *testing.PB) {
11 var buf ByteBuffer
12 for pb.Next() {
13 for i := 0; i < 100; i++ {
14 buf.Write(s)
15 }
16 buf.Reset()
17 }
18 })
19}
20
21func BenchmarkBytesBufferWrite(b *testing.B) {
22 s := []byte("foobarbaz")

Callers

nothing calls this directly

Calls 2

WriteMethod · 0.95
ResetMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…