diff options
author | Valery Piashchynski <[email protected]> | 2021-07-22 15:42:45 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-07-22 15:42:45 +0300 |
commit | ae2bdd71874c0714f476a945ab805e0eb4b532ae (patch) | |
tree | 0f37e37128c97615f07a6d2bab252a52d69a7269 /pkg | |
parent | 92aa2e4bc8b00b74e2941df6ac73de19de9e3a87 (diff) |
Update static_pool_batched test
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'pkg')
-rwxr-xr-x | pkg/pool/static_pool_test.go | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/pkg/pool/static_pool_test.go b/pkg/pool/static_pool_test.go index c57b1683..705f6bfe 100755 --- a/pkg/pool/static_pool_test.go +++ b/pkg/pool/static_pool_test.go @@ -586,6 +586,8 @@ func Benchmark_Pool_Echo(b *testing.B) { } // Benchmark_Pool_Echo_Batched-32 366996 2873 ns/op 1233 B/op 24 allocs/op +// PTR -> Benchmark_Pool_Echo_Batched-32 406839 2900 ns/op 1059 B/op 23 allocs/op +// PTR -> Benchmark_Pool_Echo_Batched-32 413312 2904 ns/op 1067 B/op 23 allocs/op func Benchmark_Pool_Echo_Batched(b *testing.B) { ctx := context.Background() p, err := Initialize( @@ -601,12 +603,23 @@ func Benchmark_Pool_Echo_Batched(b *testing.B) { assert.NoError(b, err) defer p.Destroy(ctx) + bd := make([]byte, 1024) + c := make([]byte, 1024) + + pld := &payload.Payload{ + Context: c, + Body: bd, + } + + b.ResetTimer() + b.ReportAllocs() + var wg sync.WaitGroup for i := 0; i < b.N; i++ { wg.Add(1) go func() { defer wg.Done() - if _, err := p.Exec(&payload.Payload{Body: []byte("hello")}); err != nil { + if _, err := p.Exec(pld); err != nil { b.Fail() log.Println(err) } |