This commit is contained in:
Todd Gruben 2018-01-19 12:07:08 -06:00 committed by Travis Turner
parent 0757a84f69
commit f825bc3b80
No known key found for this signature in database
GPG key ID: 7F08008DFD9314C9
2 changed files with 5 additions and 4 deletions

View file

@ -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 {

View file

@ -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))
}
}