MCPcopy Create free account
hub / github.com/deepflowio/deepflow / BenchmarkNativePoolOverPut

Function BenchmarkNativePoolOverPut

server/libs/pool/pool_test.go:75–84  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

73}
74
75func BenchmarkNativePoolOverPut(b *testing.B) {
76 pool := &sync.Pool{New: func() interface{} { return 0 }}
77 for i := 0; i < 1024; i++ {
78 pool.Put(0)
79 }
80 b.ResetTimer()
81 for i := 0; i < b.N; i++ {
82 pool.Put(0)
83 }
84}
85
86func BenchmarkLockFreePoolGetPut1Thread(b *testing.B) {
87 pools := make([]*LockFreePool[int], b.N/1024)

Callers

nothing calls this directly

Calls 1

PutMethod · 0.65

Tested by

no test coverage detected