Conversation
… wording A table message that holds a message of another crate with a bytes field, such as google.protobuf.Any, copies the field on decode. Say so in the CodecStrategy::Table docs, the guide, DESIGN.md and the runtime docs, and point at the guide for the measurements. Correct the bridge module docs (dangling list, renamed constructors, Rope copy), qualify the size claim, drop the fallback warning's claim that a fallback is larger, and shorten the changelog fragment to a user-level summary.
…ested bytes Add codegen tests for a holder declared before the message it holds, cycles with and without a bytes field, repeated bytes, map values, the bytes-key carve-out and a nested message. Add buffa-test checks that the messages set to unrolled really have no table, and a test that pins the copy of an Any payload.
|
All contributors have signed the CLA ✍️ ✅ |
This was referenced Sep 23, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Message fields of a table message can now hold messages that have no table: unrolled ones,
extern_pathtypes, and well-known types. Onwhatsapp.proto(752 messages,Boxfields, fat LTO), the text section atopt-level = "z"is 1,669,507 bytes unrolled, 1,236,115 withCodecStrategy::Tableon #469, and 1,009,611 here; table messages go from 636 to 709 of 752, because 73 of the 116 that fell back on #469 only held a message with aoneoformap, and 43 have one. The guide has thesand3figures.A field's descriptor holds the child's table or a
DynVt, function pointers that call the child'sMessageimpl.MsgVt::new_via_messageandRepVt::new_via_messageare newconst fns inbuffa::table; a child reached this way decodes from the slice of the nearest enclosing table message, so an overrun fails at that message's end.Differences from #469:
&[u8]and would copy theBytesfields. Another crate's child is not inspected, so a holder ofgoogle.protobuf.Any(valueisBytes) keeps its table and copies the payload.DynVtwrite function takes thePreSizedcursor thatMessage::encodeuses for everyBufMut. Any other sink, including aBufMutpassed toMessage::write_to, gets each child from a scratchVec; aRopecopies again.Instructions per call against all unrolled: a table parent with nine unrolled children is +6.5% to size, +7.3% to encode, +6.5% to decode; a table message of two
Timestampfields is +54%, +41%, +31%. Table-to-table fields cost 0.3% to 1.2% more than on #469.The
unsafeintable/bridge.rsis three thunks that cast*const u8back to the child type, and theChildmethods forwarding to them.