(b *testing.B)
| 73 | } |
| 74 | |
| 75 | func 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 | |
| 86 | func BenchmarkLockFreePoolGetPut1Thread(b *testing.B) { |
| 87 | pools := make([]*LockFreePool[int], b.N/1024) |