1
0
mirror of https://github.com/fumiama/blake2b-simd.git synced 2026-06-20 02:40:41 +08:00

Fix benchmarks to report proper values. (#7)

```
$ go test -run=NONE -bench .
PASS
BenchmarkHash64-4  	 1000000	      1036 ns/op	  61.77 MB/s
BenchmarkHash128-4 	 2000000	       801 ns/op	 159.67 MB/s
BenchmarkHash1K-4  	  500000	      2464 ns/op	 415.53 MB/s
BenchmarkHash8K-4  	  200000	     11212 ns/op	 730.60 MB/s
BenchmarkHash32K-4 	   30000	     40766 ns/op	 803.80 MB/s
BenchmarkHash128K-4	   10000	    163170 ns/op	 803.28 MB/s
ok  	github.com/minio/blake2b-simd	10.298s
```
This commit is contained in:
Harshavardhana
2016-07-03 12:58:02 -07:00
committed by Frank
parent 00562011ad
commit cf4f8e0c34
6 changed files with 63 additions and 79 deletions

View File

@@ -40,8 +40,8 @@ func haveAVX() bool {
// haveAVX2 returns true if when there is AVX2 support
func haveAVX2() bool {
mfi, _, _, _ := cpuid(0)
// Check AVX2, AVX2 requires OS support, but BMI1/2 don't.
if mfi >= 7 && haveAVX() {
_, ebx, _, _ := cpuidex(7, 0)