-
Notifications
You must be signed in to change notification settings - Fork 30
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
Optimizations for encoding and decoding #46
Conversation
All the decode stuff has been through review. Relevant tests are passing. After we're confident in the encoding stuff I'd like to merge. |
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.
I looked at the encoding logic (which I know best) and some parts of the decoding logic (with which I am less familiar). I have some suggestions. The main thing is I'd like a unit test of the unrolled encode/decode.
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.
Thanks for those edits; looks good to me (though again I'm less familiar with the decoding side of things).
Supersedes #45 now. Includes changes to improve decoding and encoding.
This replaces decodeWire with a function that does direct parsing instead of via the cereal library. The most important element is that it also replaces the varint128 decoding with a fully unrolled version, which should greatly improve performance.
On top of that we also swap to use IntMap throughout and get rid of the Seqs for lists, which should also cut some modest overhead.
On encodings, we use unpacked constructors for the Builder which is a pair of a length and bytestring builder, and also unroll the encoding of varint128s for some modest gain.