Closed moCello closed 8 months ago
Even though this seems like a plausible way of improving the performance, it actually neither improves the proving nor the verification time.
We might see an increase in performance in the circuit composition but since we store the circuit description (the values of the circuit after it has been composed), a change to a constant BlsScalar
-1
doesn't lead to an increase in performance.
This will not increase performance in proving or verification times.
Summary
The repository stores “one” as a constant, but every time we need a negative one, it is recomputed using the relatively expensive
neg()
function. Negative one is used in several important functions such asassert_equal()
,assert_equal_constant()
,component_boolean()
, and a few other places. Because it is used relatively frequently, it may be worth storing it once rather than recomputing it every time.Recommendation: consider whether it’s worth storing negative_one as a constant to increase performance.
Relevant Context
Performance improvement recommendation from the audit.