-
Notifications
You must be signed in to change notification settings - Fork 16
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
Buffer reuse #97
Buffer reuse #97
Conversation
This Trait allows reusing a buffer while reading
match e { | ||
StreamDelimitError::VarintDecodeError(i) => i, | ||
e => io::Error::new(io::ErrorKind::InvalidData, format!("{}", e)), | ||
} |
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.
Not sure if its fine to just shunt all errors into the InvalidData kind
I'll have to review this PR more closely so I can have an answer for this. It could take more time.
Unless you really want to, you don't need to worry about version bumps - after merging all the PRs, I can take care of the version bumps for the next release. |
So, I had a thorough look at serde-protobuf, and found some unfortunate things:
On the pq-side, I did not find any area where perf could be easily improved. (aside from changing the protobuf library). So, aside from addressing comments from your side, I'd consider this PR series finished. Cheers! |
Verified on my end with pmap and the new PR has much less memory used. Tests passing. Thanks for another great contribution. |
Avoid reallocating the Protocol message buffer by introducing a Trait that abstracts over the concrete stream type and accepts a mutable buffer.
Furthermore, the ByteConsumer Iterator impl is now based on the FramedRead.
Will update the PR with profiling data once I am back at work with access to the test dataset
There are some open questions:
EDIT:
Time after this PR:
$ time ./pq --msgtype simmo.TranshipmentCandidate --fdsetdir ./fdset --stream i32be < candidates.proto.ld > /dev/null
real 1m12.450s
user 1m11.133s
sys 0m1.047s
For comparison: achieved Result from previous PR:
$ time ./pq --msgtype simmo.TranshipmentCandidate --fdsetdir ./fdset --stream i32be < candidates.proto.ld > /dev/null
real 1m19.370s
user 1m14.457s
sys 0m4.568s