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

Function BenchmarkBytePool_Get

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

Source from the content-addressed store, hash-verified

31}
32
33func BenchmarkBytePool_Get(b *testing.B) {
34 runtime.GOMAXPROCS(1)
35
36 var pool = utils.NewBytePool(1)
37 b.ResetTimer()
38
39 for i := 0; i < b.N; i++ {
40 var buf = pool.Get()
41 _ = buf
42 pool.Put(buf)
43 }
44}
45
46func BenchmarkBytePool_Get_Parallel(b *testing.B) {
47 runtime.GOMAXPROCS(1)

Callers

nothing calls this directly

Calls 3

NewBytePoolFunction · 0.92
GetMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected