(b *testing.B)
| 84 | } |
| 85 | |
| 86 | func BenchmarkLockFreePoolGetPut1Thread(b *testing.B) { |
| 87 | pools := make([]*LockFreePool[int], b.N/1024) |
| 88 | for p, _ := range pools { |
| 89 | pool := NewLockFreePool(func() int { return 0 }) |
| 90 | for i := 0; i < 1024; i++ { |
| 91 | pool.Put(0) |
| 92 | } |
| 93 | pools[p] = pool |
| 94 | } |
| 95 | |
| 96 | b.ResetTimer() |
| 97 | |
| 98 | for _, p := range pools { |
| 99 | for i := 0; i < 1024; i++ { |
| 100 | p.Get() |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | func BenchmarkLockFreePoolGetPut2Thread(b *testing.B) { |
| 106 | pools := make([]*LockFreePool[int], 16) |
nothing calls this directly
no test coverage detected