From eb46c5146c4ad7b8a379057b9ddac0383b77883e Mon Sep 17 00:00:00 2001 From: gobwas Date: Mon, 22 Feb 2016 22:17:25 +0300 Subject: [PATCH] test parallel --- match/btree_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/match/btree_test.go b/match/btree_test.go index 814f715..ba8b99b 100644 --- a/match/btree_test.go +++ b/match/btree_test.go @@ -75,8 +75,9 @@ func BenchmarkMatchBTree(b *testing.B) { bt := NewBTree(v, l, r) - b.SetParallelism(1) - for i := 0; i < b.N; i++ { - bt.Match(fixture) - } + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + bt.Match(fixture) + } + }) }