-
Notifications
You must be signed in to change notification settings - Fork 160
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
add unsafe constructors to nodes for deserialization #1453
add unsafe constructors to nodes for deserialization #1453
Conversation
@bobbinth I have a draft PR here for feedback. Main question is how best to organize the deserialization for benchmarking. I have just put deserialization code from the LMK if anything doesn't make sense with the node constructors themselves. I split up the |
I've had a pass at the deserialization benchmark. My understanding is that I need to provide a path to a Will look at how to bundle the |
Thank you for taking this one on! Haven't had a chance to look at the PR yet.
I would run the benchmark on So the simplest benchmark I see has similar steps to some of our tests (e.g. here)
You could also put the library source code in separate files, but that's up to you - and I'd get the above working first regardless. Also caveat: we found a bug recently. TLDR: Make sure that you don't have 2 functions that differ only by the decorators they call. An example failing test case is:
|
I would probably run the deserialization benchmark on something sizable - so, One way to do this is to embed the binary of |
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 good! Thank you for tackling this! In addition to the comments about the benchmark above, I left a couple of minor comments inline.
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! Thank you! I left a few non-blocking comments inline. This is in addition to #1453 (comment), which is also non-blocking.
Have followed up with the latest suggested changes. Updated description with benchmark results for this branch vs next. Seems like 10x as you suspected @bobbinth. |
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.
All looks great! Thank you again for working on this! I'll merge as soon as CI is green.
One thing I've been thinking about is how to make it so that we deserialize things like miden-stdlib
only once. We could have a static variable and use LazyLock
in std
context, but not sure whats the best way to handle it in no-std
context.
Closes #1391
Optimization that avoids recomputing MastNode hashes during deserialization. Seems like a 10x improvement, see results below.
Adds benchmarks for standard library deserialization.
Updates BasicBlockNode constructors and converts an assert to an error flow instead.
Latest commit:
Head of next banch: