-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce cloning overhead #83
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks a lot!
@dvdplm happy to hear your thoughts compared to your approach |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I'm good with this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. It looks like GenerationState
never needs the full GenerationInputs
isn't it? So maybe it would be more "honest" to have another struct there?
|
Yes, but I meant (though not 100% sure) that the field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome, much better than #81!
One word of caution though: it is going to be important to keep track of when GenerationInputs
has been trimmed and when it's full-fat. In some sense the trimmed/full-fat versions are different types and it would be safer to actually have different types for them, so that it becomes impossible to misuse trim()
.
So should the two different types be implemented in this PR already? |
Yeah I'll take care of that tomorrow unless you want to go ahead and handle it yourself after the merge |
Alternative to #81 for reducing the overhead of
GenerationInputs
cloning. The rationale is that once the inputs have been processed, some are unneeded to carry on with witness generation / proof execution, and can be trimmed off, alleviating the downside of cloning. Also some method signatures have been changed to take a reference to theGenerationInputs
.Could actually be done against main, but continuations branch has done some changes around, so probably better to just redirect this tweak there.