MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / BenchmarkNewBufferPool4

Function BenchmarkNewBufferPool4

internal/utils/buffer_pool_test.go:62–73  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

60}
61
62func BenchmarkNewBufferPool4(b *testing.B) {
63 var pool = utils.NewBufferPool()
64 var dataString = strings.Repeat("Hello", 1024)
65
66 b.RunParallel(func(pb *testing.PB) {
67 for pb.Next() {
68 var buffer = pool.Get()
69 buffer.WriteString(dataString)
70 pool.Put(buffer)
71 }
72 })
73}

Callers

nothing calls this directly

Calls 5

NewBufferPoolFunction · 0.92
NextMethod · 0.80
WriteStringMethod · 0.80
GetMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected