Skip to content

perf: Call reserve() upfront to avoid unnecessary reallocation (#765)#765

Closed
MatzeB wants to merge 1 commit into
facebookincubator:mainfrom
MatzeB:export-D100823409
Closed

perf: Call reserve() upfront to avoid unnecessary reallocation (#765)#765
MatzeB wants to merge 1 commit into
facebookincubator:mainfrom
MatzeB:export-D100823409

Conversation

@MatzeB
Copy link
Copy Markdown
Contributor

@MatzeB MatzeB commented May 21, 2026

Summary:

This change was generated by pointing an AI agent at hot functions showing up in our internal profiles. It was reviewed by a human (outside the velox team):

Added decoders_.reserve(streams.size()) before the loop in VeloxReader::loadNextStripe() that populates the folly::F14FastMap<offset_size, std::unique_ptr<Decoder>> decoders_ container. The map is cleared right before this loop, so reserving streams.size() buckets upfront avoids expensive rehashing during the insertion loop. No functionality changes were made.

Reviewed By: yuxuanchen1997

Differential Revision: D100823409

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label May 21, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 21, 2026

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

…ookincubator#765)

Summary:

This change was generated by pointing an AI agent at hot functions showing up in our internal profiles. It was reviewed by a human (outside the velox team):

Added `decoders_.reserve(streams.size())` before the loop in `VeloxReader::loadNextStripe()` that populates the `folly::F14FastMap<offset_size, std::unique_ptr<Decoder>> decoders_` container. The map is cleared right before this loop, so reserving `streams.size()` buckets upfront avoids expensive rehashing during the insertion loop. No functionality changes were made.

Reviewed By: yuxuanchen1997

Differential Revision: D100823409
@meta-codesync meta-codesync Bot changed the title perf: Call reserve() upfront to avoid unnecessary reallocation (#660) perf: Call reserve() upfront to avoid unnecessary reallocation (#765) May 22, 2026
@MatzeB MatzeB force-pushed the export-D100823409 branch from bd156bf to 56096c2 Compare May 22, 2026 05:27
@meta-codesync meta-codesync Bot closed this in b52daa9 May 23, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 23, 2026

This pull request has been merged in b52daa9.

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. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant