From b725d6015f980e94734da37e35ba0d943fc7532f Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Tue, 6 Dec 2016 17:57:29 -0500 Subject: [PATCH] ch2/popcount: show go1.7 SSA benchmarks Change-Id: I1e9b29320e938a1dc8763f66b243c1a08f33b7d7 --- ch2/popcount/popcount_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ch2/popcount/popcount_test.go b/ch2/popcount/popcount_test.go index 504548d0b..840ee0a44 100644 --- a/ch2/popcount/popcount_test.go +++ b/ch2/popcount/popcount_test.go @@ -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