1
0
mirror of https://github.com/fumiama/blake2b-simd.git synced 2026-06-05 02:00:26 +08:00
Go to file
Harshavardhana cf4f8e0c34 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
```
2016-07-03 21:58:02 +02:00
2016-06-28 09:28:56 -07:00
2016-07-03 11:54:51 -07:00
2016-07-03 11:54:51 -07:00
2016-07-03 11:54:51 -07:00
2016-07-03 11:54:51 -07:00
2016-07-03 11:54:51 -07:00
2016-06-24 20:09:36 +02:00
2016-06-28 17:21:01 -07:00

BLAKE2b-SIMD

Pure Go implementation of BLAKE2b using SIMD optimizations.

Introduction

This package is based on the pure go BLAKE2b implementation of Dmitry Chestnykh and merges it with the (cgo dependent) SSE optimized BLAKE2 implementation (which in turn is based on official implementation. It does so by using Go's Assembler for amd64 architectures with a fallback for other architectures.

It gives roughly a 3x performance improvement over the non-optimized go version.

Benchmarks

Dura 1 GB
blake2b-SIMD 1.59s
blake2b 4.66s

Example performance metrics were generated on Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz - 2 physical cores, 4 logical cores running Ubuntu GNU/Linux with kernel version 4.4.0-22-generic.

benchmark                old ns/op     new ns/op     delta
BenchmarkHash64-4        742           411           -44.61%
BenchmarkHash128-4       681           346           -49.19%
BenchmarkWrite1K-4       4239          1497          -64.69%
BenchmarkWrite8K-4       33633         11514         -65.77%
BenchmarkWrite32K-4      134091        45947         -65.73%
BenchmarkWrite128K-4     537976        183643        -65.86%

benchmark                old MB/s     new MB/s     speedup
BenchmarkHash64-4        86.18        155.51       1.80x
BenchmarkHash128-4       187.96       369.10       1.96x
BenchmarkWrite1K-4       241.55       683.87       2.83x
BenchmarkWrite8K-4       3897.06      11383.41     2.92x
BenchmarkWrite32K-4      977.48       2852.63      2.92x
BenchmarkWrite128K-4     243.64       713.73       2.93x

We can see 2-3x improvement in performance over native Go under varying block sizes.

Description
Fast hashing using pure Go implementation of BLAKE2b with SIMD instructions
Readme Apache-2.0 230 KiB
Languages
Go 51.4%
Assembly 48.6%