Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "testing"
- )
- func Benchmark_withoutPool(b *testing.B) {
- p := NoPool{}
- b.N = b.N * 10
- for i := 0; i < b.N; i++ {
- p.Process()
- }
- b.ReportAllocs()
- }
- func Benchmark_withPool(b *testing.B) {
- p := WithPool{}
- b.N = b.N * 10
- for i := 0; i < b.N; i++ {
- p.Process()
- }
- b.ReportAllocs()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement