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

Function BenchmarkNewBufferPool2

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

Source from the content-addressed store, hash-verified

34}
35
36func BenchmarkNewBufferPool2(b *testing.B) {
37 var pool = utils.NewBufferPool()
38 var data = []byte(strings.Repeat("Hello", 1024))
39
40 b.RunParallel(func(pb *testing.PB) {
41 for pb.Next() {
42 var buffer = pool.Get()
43 buffer.Write(data)
44 pool.Put(buffer)
45 }
46 })
47}
48
49func BenchmarkNewBufferPool3(b *testing.B) {
50 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