Skip to content

perf: Use Vec::with_capacity in cast_to_run_end_encoded#8726

Merged
alamb merged 3 commits into
apache:mainfrom
vegarsti:cast-ree-allocate
Oct 30, 2025
Merged

perf: Use Vec::with_capacity in cast_to_run_end_encoded#8726
alamb merged 3 commits into
apache:mainfrom
vegarsti:cast-ree-allocate

Conversation

@vegarsti

@vegarsti vegarsti commented Oct 27, 2025

Copy link
Copy Markdown
Contributor

Related to #8707.

Inspired by #8716 (comment), a follow up improvement to #8589: We already know what the length of the two vectors will be, so we can create them with that capacity.

@github-actions github-actions Bot added the arrow Changes to the arrow crate label Oct 27, 2025
@vegarsti vegarsti changed the title perf: Reduce allocations in cast_to_run_end_encoded perf: Use vec::with_capacity in cast_to_run_end_encoded Oct 28, 2025
@vegarsti vegarsti changed the title perf: Use vec::with_capacity in cast_to_run_end_encoded perf: Use Vec::with_capacity in cast_to_run_end_encoded Oct 28, 2025

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vegarsti

@Weijun-H Weijun-H left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement! Thanks @vegarsti 👍

@alamb alamb merged commit 2eabb59 into apache:main Oct 30, 2025
26 checks passed
@alamb

alamb commented Oct 30, 2025

Copy link
Copy Markdown
Contributor

Thanks again @vegarsti and @Weijun-H

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

Labels

arrow Changes to the arrow crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants