mopro
mopro copied to clipboard
Improve native witness generation performance with circom-witness-rs
Problem
When running RSA circuit we get:
Initializing library with arkzkey
Time to deserialize proving key: 7.937347541s
Time to deserialize matrices: 28.784083ms
Initializing arkzkey took: 8.00s
Generating proof 2
Witness generation took: 4.73s
Loading arkzkey took: 125.00ns
proof generation took: 1.14s
That is, witness generation takes 80% of time.
Notes
We want to try to integrate this as it looks promising: https://github.com/philsippl/circom-witness-rs
Since it is experimental we want to keep it under a feature flag.
We want to do this because it is low hanging fruit and we know for sure that it'll have any impact if it works.
Also getting rid of WASM will have many other benefits.
Acceptance criteria
Experimental support for native witness generator should get this down x10 faster, without wasm.
Ideally we also try this for larger circuits.