celo-org / celo-bls-snark-rs

Implements SNARK-friendly BLS signatures
https://celo.org
Apache License 2.0
83 stars 24 forks source link

Produce benchmark reports #218

Closed kobigurk-clabs closed 2 years ago

kobigurk-clabs commented 3 years ago
gtank commented 2 years ago

The batch verification code in #222 runs benchmarks with the following paramters: https://github.com/celo-org/celo-bls-snark-rs/blob/13cc5666de0bbd51ebea12d373819bf763bcb99f/crates/bls-crypto/benches/batch_bls.rs#L12-L17

These are NOT real benchmark results, they came from my laptop while doing other things, but the general shape is clear. Aggregate screening is faster than batch verification but does not provide the same security guarantees. Batch verification remains much, much faster than individually verifying signatures.

"per epoch aggregate" adds the signatures together for one epoch "all epoch aggregate" does a single aggregate signature against many keys and hashes "per epoch batch" uses the new code with a random linear combination of signatures and keys against a fixed message "per epoch individual" validates every signature individually

bls/per-epoch aggregate screening
                        time:   [976.61 ms 980.90 ms 985.14 ms]
bls/all epoch aggregate screening
                        time:   [269.52 ms 270.88 ms 272.22 ms]
bls/per-epoch batch verification
                        time:   [1.6660 s 1.6676 s 1.6695 s]
bls/per-epoch individual verification
                        time:   [19.397 s 19.417 s 19.442 s]
gtank commented 2 years ago

I'll close this issue now but we can post more benchmarks in the future, for further optimization work or other modes.