zkcrypto / bellman

zk-SNARK library.
Other
988 stars 534 forks source link

Refactor `multiexp` to cache exponent chunks #83

Closed str4d closed 2 years ago

str4d commented 2 years ago

BitArray iteration is slower in bitvec 1.0 than bitvec 0.22. The refactor minimises the amount of bit iteration done in multiexp, avoiding repeated iteration across parallel workers.

str4d commented 2 years ago

This PR causes a performance regression in the multiexp/65536 benchmark:

multiexp/65536          time:   [139.41 ms 140.03 ms 140.65 ms]                           
                        change: [+9.8093% +10.643% +11.494%] (p = 0.00 < 0.05)
                        Performance has regressed.

But it partially solves a performance regression in the Sapling circuit, so 🤷