-
Notifications
You must be signed in to change notification settings - Fork 5
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
binary serialization and zstd compression for Eigen types [OC-293] #451
Conversation
compressed.resize(compressed_bound); | ||
|
||
const std::size_t compressed_size = | ||
// I solemnly swear that I am up to no good. |
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.
Maybe describe the situation you think could cause a failure here and/or why it won't happen, in place of this and the below comments.
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.
Lol, I'll remove those.
|
||
TEST(Compress, DecompressEmpty) { | ||
std::string inputs; | ||
ASSERT_DEATH({ const auto result = albatross::zstd::decompress(inputs); }, |
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.
Is this something we would want to assert on? One recent issue that has come up in the AQ, the current solution is to return an empty model instead of asserting. Could this cause issues on the receiving end? @jbangelo
https://github.com/swift-nav/orion-engine/pull/6939
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'm not sure if we have a better way to handle failures here. These routines get used in the cereal
serialisation / deserialisation routines, and I'm not aware of a way to propagate deserialisation failures via the cereal
API.
The code this is replacing also asserted on any detected decompression failure, so for this change I chose to preserve that behavior.
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.
Add a description to the PR and take a look at my comments. Otherwise LGTM!
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
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, nit: the title mostly says it, but the PR is missing a description (why the switch to zstd?)
Previously the serialization routines used gzip. This commit modifies them to use zstd, which pareto-dominates gzip apart from breadth of software distribution.
Currently
albatross
serializes large vectors and matrices byIn a head-to-head test on systems internal to Swift, we were able to reduce serialization time to about 0.4 of the current approach by using Cereal's portable binary archive type and compressing with zstd. This patch switches Albatross to use the latter approach.