mopro icon indicating copy to clipboard operation
mopro copied to clipboard

Improve zkey load time

Open oskarth opened this issue 1 year ago • 12 comments

Problem

It is slow to load zkey.

cargo test --release test_generate_proof2 -- --nocapture shows it takes ~70-80s to load in zkey for a ~80mb file (Keccak256).

Zkey is ~80mb but would expect this to be much faster.

This seems to be the case regardless of if we are using dylib or not.

Approaches

Two ideas:

  1. Figure out how to improve in terms of reading in the zkey file (maybe memmap or something, but this adds complexity for iOS integration)
  2. Do this separately and persist arkworks ProvingKey in a better way (e.g. serialize to disk beforehand)

Acceptance criteria

Much faster loading of zkey, or other way to improve this type of load up time

oskarth avatar Oct 31 '23 05:10 oskarth