roachpb: Protobuf encoding does not omit empty messages #85312
Labels
A-kv
Anything in KV that doesn't belong in a more specific category.
C-performance
Perf of queries or internals. Solution not expected to change functional behavior.
T-kv
KV Team
As seen over in #85138 (comment), it appears that gogoproto is encoding embedded messages even though they are empty. In other words, consider this message:
Even though empty Protobuf fields can be omitted, gogoproto will encode an empty
Foo
into 2 bytes:0x0a 0x00
, which essentially says field 1 of wire type delimited with length 0 (see encoding spec).The encoding should be able to omit this field entirely, which might net us some minor savings throughout the codebase (e.g. for every unset timestamp field).
Jira issue: CRDB-18178
The text was updated successfully, but these errors were encountered: