-
Notifications
You must be signed in to change notification settings - Fork 372
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
perf/feature: new serialization format for constraint systems #1119
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.
Very nice optimizations! I think in general is good, but in a perfect scenario I would try to figure out if we can work with io.Writer
and io.Reader
instead of direct byte arrays as imo otherwise we have many copies of very similar structures in memory (constraint system itself, bytes when serializing them and also byte buffer for internal steps a la serializing calldata). But due to applying compression to uints we still cannot get away with all.
And I completely agree that it doesn't make sense for us to include additional compression in the implementation. It should be straightforward to add gzip
etc. when the user is interested in it. Otherwise there is too many options (fast or good compression ...)
Yep, it makes sense that if we work with Good to merge from my side. |
Description
This PR uses integer compression techniques to serialize some constraint systems parts containing ids, offsets, etc and bypass our current cbor choice. (cbor is still used for the rest).
As a bench, using
lzss.DecompressionTestCircuit
with params landing at 90M constraints (plonk), we go from 9225Mb to 2238Mb size, plus, we serialize (and most importantly deserialize) way faster: