Skip to content

Reserve serialized value buffers efficiently#942

Open
pankajsh909 wants to merge 1 commit into
facebookincubator:mainfrom
pankajsh909:export-D110654254
Open

Reserve serialized value buffers efficiently#942
pankajsh909 wants to merge 1 commit into
facebookincubator:mainfrom
pankajsh909:export-D110654254

Conversation

@pankajsh909

Copy link
Copy Markdown

Summary: Use the existing exact serialization-header size estimate to reserve known header bytes before writing, avoiding the previous 4 KB minimum allocation for tiny headers. Keep geometric growth for Vector append paths where the full serialized stream payload is not known without buffering or a dry run. Add SerializationHeaderTest coverage for the Vector header reservation path.

Reviewed By: xiaoxmeng

Differential Revision: D110654254

Summary: Use the existing exact serialization-header size estimate to reserve known header bytes before writing, avoiding the previous 4 KB minimum allocation for tiny headers. Keep geometric growth for Vector<char> append paths where the full serialized stream payload is not known without buffering or a dry run. Add SerializationHeaderTest coverage for the Vector<char> header reservation path.

Reviewed By: xiaoxmeng

Differential Revision: D110654254
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 7, 2026
@meta-codesync

meta-codesync Bot commented Jul 7, 2026

Copy link
Copy Markdown

@pankajsh909 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D110654254.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant