Skip to content

perf: preallocate sortStringExprs chunk slice size#1475

Open
jbedard wants to merge 3 commits into
bazelbuild:mainfrom
jbedard:chunk-sizes
Open

perf: preallocate sortStringExprs chunk slice size#1475
jbedard wants to merge 3 commits into
bazelbuild:mainfrom
jbedard:chunk-sizes

Conversation

@jbedard

@jbedard jbedard commented Jun 10, 2026

Copy link
Copy Markdown

Buildtools PR checklist

  • The code in this PR is covered by unit/integration tests.
  • I have tested these changes and provide testing instructions below.
  • I have either responded to, or resolved all Gemini comments on the PR.
  • I have read Google Eng Practices on Small Changes, this PR either follows these guidelines or the description provides reasoning for why they can not be followed.

Description

The list size is guaranteed and can be pre-\allocatted.

@jbedard jbedard requested a review from a team as a code owner June 10, 2026 03:48
@jbedard jbedard requested review from oreflow and removed request for a team June 10, 2026 03:48

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request optimizes slice allocation in build/rewrite.go by preallocating capacity for the chunk slice. The reviewer suggested a further optimization to initialize the slice with the exact length and assign elements directly by index to avoid the overhead of append.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread build/rewrite.go Outdated
jbedard and others added 2 commits June 17, 2026 10:20
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant