30 lines
399 B
Go
30 lines
399 B
Go
package bloom
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"crypto/sha1"
|
|
"crypto/sha256"
|
|
)
|
|
|
|
func BenchmarkJenkins(b *testing.B) {
|
|
j := jenkinsHash{}
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
j.ComputeHash([]byte{byte(i)})
|
|
}
|
|
}
|
|
|
|
func BenchmarkSHA1(b *testing.B) {
|
|
for i := 0; i < b.N; i++ {
|
|
sha1.Sum([]byte{byte(i)})
|
|
}
|
|
}
|
|
|
|
|
|
func BenchmarkSHA256(b *testing.B) {
|
|
for i := 0; i < b.N; i++ {
|
|
sha256.Sum256([]byte{byte(i)})
|
|
}
|
|
}
|
|
|