1
0
mirror of https://github.com/fumiama/blake2b-simd.git synced 2026-06-09 04:30:13 +08:00

internal: use arrays instead of make for simple values. (#22)

Fixes #16
This commit is contained in:
Harshavardhana
2016-07-22 02:38:12 -07:00
committed by Frank
parent 326c321661
commit c50cace0dc
5 changed files with 26 additions and 22 deletions

View File

@@ -27,11 +27,11 @@ import (
func benchmarkHash(b *testing.B, hash func() hash.Hash) {
b.SetBytes(1024 * 1024)
data := make([]byte, 1024)
var data [1024]byte
for i := 0; i < b.N; i++ {
h := hash()
for j := 0; j < 1024; j++ {
h.Write(data)
h.Write(data[:])
}
h.Sum(nil)
}
@@ -59,7 +59,7 @@ func BenchmarkComparisonBlake2B(b *testing.B) {
// Benchmark blake2b implementation.
var bench = New512()
var buf = make([]byte, 128*1024)
var buf [128 * 1024]byte
func benchmarkSize(b *testing.B, size int) {
b.SetBytes(int64(size))