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

Function BenchmarkBytePool_Get_Parallel

internal/utils/byte_pool_test.go:46–58  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

44}
45
46func BenchmarkBytePool_Get_Parallel(b *testing.B) {
47 runtime.GOMAXPROCS(1)
48
49 var pool = utils.NewBytePool(1024)
50 b.ResetTimer()
51
52 b.RunParallel(func(pb *testing.PB) {
53 for pb.Next() {
54 var buf = pool.Get()
55 pool.Put(buf)
56 }
57 })
58}
59
60func BenchmarkBytePool_Get_Sync(b *testing.B) {
61 runtime.GOMAXPROCS(1)

Callers

nothing calls this directly

Calls 4

NewBytePoolFunction · 0.92
NextMethod · 0.80
GetMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected