feat: Improve proving speed by caching zkey curve#124
Merged
phated merged 1 commit intoiden3:masterfrom Jun 12, 2022
Merged
Conversation
f227268 to
72ca104
Compare
Contributor
Author
|
Rebased and tested with the snarky sudoku repo again. Ready for merge. |
72ca104 to
cb6badc
Compare
Contributor
Author
|
Rebased on latest master and ready for review again. Tested on this repo branch that's deployed here if someone else wants to test. |
Contributor
|
@nalinbhardwaj can you rebase this now that I got CI all green?? Thanks! |
cb6badc to
c47007b
Compare
Contributor
Author
|
@phated done, all green ✅ |
phated
reviewed
Jun 12, 2022
phated
reviewed
Jun 12, 2022
Contributor
|
Thanks! One question, and also, please remove the built files from the PR. They get built by jordi during release (there are actually 4 files that need to be built). |
c47007b to
7cdbb35
Compare
Contributor
Author
done |
Contributor
|
Thanks @nalinbhardwaj 🎉 Sorry it has taken so long to get this landed. It'll be included in the next release! |
Contributor
Author
|
@phated no worries, thank you for taking the time to merge it! <3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Speeds up proving by caching zkey getCurve call when reading headers and avoiding double calls in grothProve. On a smallish circuit (https://github.com/nalinbhardwaj/snarky-sudoku) this amounts to a ~30% reduction, which is pretty significant IMO:
Before:

~4 seconds runtime
After:

~3 seconds runtime
Branched on #121