mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
crypto: fix BenchmarkSha3
The extra output confuses tools like benchstat.
This commit is contained in:
parent
c637acad2b
commit
0a3a97022e
1 changed files with 1 additions and 7 deletions
|
|
@ -20,12 +20,10 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"crypto/ecdsa"
|
"crypto/ecdsa"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"math/big"
|
"math/big"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
)
|
)
|
||||||
|
|
@ -44,13 +42,9 @@ func TestKeccak256Hash(t *testing.T) {
|
||||||
|
|
||||||
func BenchmarkSha3(b *testing.B) {
|
func BenchmarkSha3(b *testing.B) {
|
||||||
a := []byte("hello world")
|
a := []byte("hello world")
|
||||||
amount := 1000000
|
for i := 0; i < b.N; i++ {
|
||||||
start := time.Now()
|
|
||||||
for i := 0; i < amount; i++ {
|
|
||||||
Keccak256(a)
|
Keccak256(a)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(amount, ":", time.Since(start))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSign(t *testing.T) {
|
func TestSign(t *testing.T) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue