📝Protobuf: wrapping fields into embedded messages might decrease their size

Because field numbers 1–15 take 1 byte to encode, if a Message has many fields past 15 which are present most of the time, it might be advantageous to wrap them into embedded message.

Embedded messages adds 2–4 bytes of overhead (1–2 bytes for field number + 1–2 bytes message size), but saves 1 bytes for each nested field.

Backlinks