Skip to content

Commit

Permalink
ch2/popcount: show go1.7 SSA benchmarks
Browse files Browse the repository at this point in the history
Change-Id: I1e9b29320e938a1dc8763f66b243c1a08f33b7d7
  • Loading branch information
adonovan committed Dec 6, 2016
1 parent 4cccb40 commit b725d60
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ch2/popcount/popcount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,23 @@ func BenchmarkPopCountByShifting(b *testing.B) {
}
}

// 2.67GHz Xeon
// Go 1.6, 2.67GHz Xeon
// $ go test -cpu=4 -bench=. gopl.io/ch2/popcount
// BenchmarkPopCount-4 200000000 6.30 ns/op
// BenchmarkBitCount-4 300000000 4.15 ns/op
// BenchmarkPopCountByClearing-4 30000000 45.2 ns/op
// BenchmarkPopCountByShifting-4 10000000 153 ns/op
//
// 2.5GHz Intel Core i5
// Go 1.6, 2.5GHz Intel Core i5
// $ go test -cpu=4 -bench=. gopl.io/ch2/popcount
// testing: warning: no tests to run
// BenchmarkPopCount-4 200000000 7.52 ns/op
// BenchmarkBitCount-4 500000000 3.36 ns/op
// BenchmarkPopCountByClearing-4 50000000 34.3 ns/op
// BenchmarkPopCountByShifting-4 20000000 108 ns/op
//
// Go 1.7, 3.5GHz Xeon
// $ go test -cpu=4 -bench=. gopl.io/ch2/popcount
// BenchmarkPopCount-12 2000000000 0.28 ns/op
// BenchmarkBitCount-12 2000000000 0.27 ns/op
// BenchmarkPopCountByClearing-12 100000000 18.5 ns/op
// BenchmarkPopCountByShifting-12 20000000 70.1 ns/op

0 comments on commit b725d60

Please sign in to comment.