From f825bc3b807d61194573dc219a79c2541d104a56 Mon Sep 17 00:00:00 2001 From: Todd Gruben Date: Fri, 19 Jan 2018 12:07:08 -0600 Subject: [PATCH] merge --- fragment_test.go | 4 ++-- roaring/assembly_test.go | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fragment_test.go b/fragment_test.go index 14d36a56c..754bd8dd1 100644 --- a/fragment_test.go +++ b/fragment_test.go @@ -1081,15 +1081,15 @@ func BenchmarkFragment_Snapshot(b *testing.B) { b.Skip("no fragment specified") } + b.ReportAllocs() // Open the fragment specified by the path. f := pilosa.NewFragment(*FragmentPath, "i", "f", pilosa.ViewStandard, 0) if err := f.Open(); err != nil { b.Fatal(err) } defer f.Close() - - // Reset timer and execute benchmark. b.ResetTimer() + // Reset timer and execute benchmark. for i := 0; i < b.N; i++ { err := f.Snapshot() if err != nil { diff --git a/roaring/assembly_test.go b/roaring/assembly_test.go index f18aa65ec..a35ae58c5 100644 --- a/roaring/assembly_test.go +++ b/roaring/assembly_test.go @@ -42,6 +42,7 @@ func TestBSFQ_CompareGo(t *testing.T) { } */ } +var Result uint64 func BenchmarkBSF(b *testing.B) { for i := 0; i < b.N; i++ { BSFQ(uint64(i)) @@ -62,7 +63,7 @@ func BenchmarkPOPCNTQ(b *testing.B) { func BenchmarkPopcount(b *testing.B) { for i := 0; i < b.N; i++ { - popcount(uint64(i)) + Result=popcount(uint64(i)) } } @@ -76,7 +77,7 @@ func BenchmarkPopcntAsm(b *testing.B) { func BenchmarkPopcntGo(b *testing.B) { // run the Fib function b.N times for n := 0; n < b.N; n++ { - popcntGo(0xdeadbeef) + Result=popcntGo(uint64(n)) } }