-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto: benchmark BLS single signing and verification #1881
Conversation
Arm64 Rasp Pi 4
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On an i3 - gen3 2 cores, 4 logical CPUs I've got:
BenchmarkBlsSingleSigner_Sign - 456.536 uS/op
BenchmarkBlsSingleSigner_Verify - 2.327 ms/op
On an i5 - gen4 2 cores, 4 logical CPUs I've got:
BenchmarkBlsSingleSigner_Sign - 445.511 uS/op
BenchmarkBlsSingleSigner_Verify - 2.255 ms/op
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz
goos: linux
goarch: amd64
BenchmarkBlsSingleSigner_Sign-4 4172 372616 ns/op
BenchmarkBlsSingleSigner_Verify-4 984 1222218 ns/op
PASS
ok command-line-arguments 11.518s
|
||
var err error | ||
nbMessages := 10000 | ||
messages := make([][]byte, 0, 10000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could have used nbMessages
.
|
||
b.ResetTimer() | ||
for i := 0; i < b.N; i++ { | ||
_, err = signer.Sign(privKey, messages[i%nbMessages]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Messages to sign are quite short. Maybe relevant to the benchmark?
|
||
var err error | ||
nbMessages := 10000 | ||
messages := make([][]byte, 0, 10000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could have used nbMessages
.
|
||
b.ResetTimer() | ||
for i := 0; i < b.N; i++ { | ||
err = signer.Verify(pubKey, messages[i%nbMessages], signatures[i%nbMessages]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Messages to verify are a bit short (see above).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
go test crypto/signing/mcl/singlesig/bls_bench_test.go -bench BlsSingleSigner
i7 7th gen
BenchmarkBlsSingleSigner_Sign-4 3208 401445 ns/op
BenchmarkBlsSingleSigner_Verify-4 870 1628854 ns/op