MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / BenchmarkNewBufferPool3

Function BenchmarkNewBufferPool3

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

Source from the content-addressed store, hash-verified

47}
48
49func BenchmarkNewBufferPool3(b *testing.B) {
50 var pool = utils.NewBufferPool()
51 var dataString = strings.Repeat("Hello", 1024)
52
53 b.RunParallel(func(pb *testing.PB) {
54 for pb.Next() {
55 var buffer = pool.Get()
56 buffer.Write([]byte(dataString))
57 pool.Put(buffer)
58 }
59 })
60}
61
62func BenchmarkNewBufferPool4(b *testing.B) {
63 var pool = utils.NewBufferPool()

Callers

nothing calls this directly

Calls 5

NewBufferPoolFunction · 0.92
NextMethod · 0.80
WriteMethod · 0.65
GetMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected