From 7feca3f0d11e46c01693d93d636655576eaa27b5 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sat, 28 Feb 2015 15:00:24 -0800 Subject: [PATCH] Add 1MB block benchmarks --- pkg/utils/crypto/sha1/sha1_test.go | 6 +++++- pkg/utils/crypto/sha256/sha256_test.go | 6 +++++- pkg/utils/crypto/sha512/sha512_test.go | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pkg/utils/crypto/sha1/sha1_test.go b/pkg/utils/crypto/sha1/sha1_test.go index bf95ede01..f2d090bac 100644 --- a/pkg/utils/crypto/sha1/sha1_test.go +++ b/pkg/utils/crypto/sha1/sha1_test.go @@ -109,7 +109,7 @@ func TestBlockGeneric(t *testing.T) { } var bench = New() -var buf = make([]byte, 8192) +var buf = make([]byte, 1024*1024) func benchmarkSize(b *testing.B, size int) { b.SetBytes(int64(size)) @@ -132,3 +132,7 @@ func BenchmarkHash1K(b *testing.B) { func BenchmarkHash8K(b *testing.B) { benchmarkSize(b, 8192) } + +func BenchmarkHash1M(b *testing.B) { + benchmarkSize(b, 1024*1024) +} diff --git a/pkg/utils/crypto/sha256/sha256_test.go b/pkg/utils/crypto/sha256/sha256_test.go index 424ff3919..cc4bb6d08 100644 --- a/pkg/utils/crypto/sha256/sha256_test.go +++ b/pkg/utils/crypto/sha256/sha256_test.go @@ -96,7 +96,7 @@ func TestBlockSize(t *testing.T) { } var bench = New() -var buf = make([]byte, 8192) +var buf = make([]byte, 1024*1024) func benchmarkSize(b *testing.B, size int) { b.SetBytes(int64(size)) @@ -119,3 +119,7 @@ func BenchmarkHash1K(b *testing.B) { func BenchmarkHash8K(b *testing.B) { benchmarkSize(b, 8192) } + +func BenchmarkHash1M(b *testing.B) { + benchmarkSize(b, 1024*1024) +} diff --git a/pkg/utils/crypto/sha512/sha512_test.go b/pkg/utils/crypto/sha512/sha512_test.go index d97857c34..f254cf605 100644 --- a/pkg/utils/crypto/sha512/sha512_test.go +++ b/pkg/utils/crypto/sha512/sha512_test.go @@ -96,7 +96,7 @@ func TestBlockSize(t *testing.T) { } var bench = New() -var buf = make([]byte, 8192) +var buf = make([]byte, 1024*1024) func benchmarkSize(b *testing.B, size int) { b.SetBytes(int64(size)) @@ -119,3 +119,7 @@ func BenchmarkHash1K(b *testing.B) { func BenchmarkHash8K(b *testing.B) { benchmarkSize(b, 8192) } + +func BenchmarkHash1M(b *testing.B) { + benchmarkSize(b, 1024*1024) +}