-
Notifications
You must be signed in to change notification settings - Fork 384
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
Encode LogMsg
using protobuf
#8347
Conversation
Latest documentation preview deployed successfully.
Note: This comment is updated whenever you push a commit. |
Web viewer built successfully. If applicable, you should also test it:
Note: This comment is updated whenever you push a commit. |
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 untangling these dependency issues!
generally looks ok to me, few comments and a question about more clear re-use of common arrow seriailzation logic to make re_log_encoding
crate clearer.
This is now tested as part of the tests in
Done for |
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 only had time for a partial review today - will take a closer look tomorrow!
crates/build/re_protos_builder/src/bin/build_re_remote_store_types.rs
Outdated
Show resolved
Hide resolved
I updated the benchmark to include protobuf variants of all the encode/decode parts. There are way too many benchmarks now, so I tried using ChatGPT to make sense of the results: Note that it messed up units, and produced total gibberish when asked to fix it. They aren't all in milliseconds. Results seem fairly mixed, some wins and some losses. The mono-points non-batched vs batched decode is interesting, as msgpack seems to be better at non-batched data? Encode seems to be a win across the board for protobuf, but only by a little. |
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.
👍
]; | ||
|
||
for options in options { | ||
println!("{options:?}"); |
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.
😬
Tip: add a // TODO
suffix on code you plan to remove (the linter will stop you from merging it).
Or use dbg!(options);
(again, this will not pass CI)
You can also just use re_log::trace
and run with RUST_LOG=re_log_encoding=trace
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 didn't plan to remove this, what's wrong with keeping a println
in a test? It doesn't get printed unless the test fails, in which case it's useful information about which part of the test failed
#[allow(clippy::match_same_arms)] | ||
match value.name.as_str() { | ||
"log_time" => Self::new_temporal(value.name), | ||
"log_tick" => Self::new_sequence(value.name), | ||
"frame" => Self::new_sequence(value.name), | ||
"frame_nr" => Self::new_sequence(value.name), | ||
_ => Self::new_temporal(value.name), |
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.
Wait, what the hack is this @teh-cmc ??
Related
enum LogMsg
with protobuf #7988re_protos
dependencies #8381What
This PR introduces
Serializer::Protobuf
tore_log_encoding
, and inverts the dependency graph ofre_protos
, which no longer depends on otherre_*
crates. This meant the conversion impls from protobuf types to rerun types and back had to be moved into their respective crates. For example,From<StoreId> for
re_protos::common::v0::StoreIdis now in
re_log_types`.When encoding a file using this serializer, the data is encoded using a combination of:
The stream-level protocol has changed only a bit, because compression is no longer done for all messages in the stream, and only the contents of
ArrowMsg
are ever compressed at all. This means theuncompressed_len
andcompressed_len
could be unified to justlen
.The actual layout of the messages has not changed,
LogMsg
is preserved and so are its semantics.The stream of data stored in an example RRD file using this new encoding looks like:
Note that this stream-level protocol is only used for
.rrd
files. On the wire, we will use gRPC, which has its own protocol.In the case of
ArrowMsg
, the schema+chunk is encoded using Arrow IPC into a byte payload, which may additionally be compressed. The compression setting is stored separately for everyArrowMsg
, but per-message compression functionality is not yet exposed throughre_log_encoding
.