Skip to content

Pre-size complete dirty dependency sets - #31217

Open
dzbarsky wants to merge 1 commit into
bazelbuild:masterfrom
dzbarsky:codex/dirty-deps-capacity-upstream
Open

dzbarsky wants to merge 1 commit into
bazelbuild:masterfrom
dzbarsky:codex/dirty-deps-capacity-upstream

Conversation

@dzbarsky

@dzbarsky dzbarsky commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Pre-size getAllRemainingDirtyDirectDeps's ImmutableSet builder from GroupedDeps.numElements() when no dependency groups have been consumed, retaining default allocation for partial suffixes.

On a representative large build we reduce total bytes allocated (from a baseline of 240GB) by 2%, which should help GC pressure a bit.

RELNOTES: None

When no dirty dependency group has been consumed, the existing GroupedDeps
element count is the exact capacity needed for the remaining-dependency
set. Use it to avoid growing and rebuilding the ImmutableSet builder.

Keep the default builder for partial suffixes so they do not allocate for
already-consumed dependencies. Traversal and position updates are unchanged.
@github-actions github-actions Bot added the awaiting-review PR is awaiting review from an assigned reviewer label Sep 19, 2026
@fmeum
fmeum requested a review from justinhorvitz September 20, 2026 11:20
@github-actions github-actions Bot added the community-reviewed Reviewed by a trusted community contributor label Sep 20, 2026
@iancha1992 iancha1992 added the team-Configurability platforms, toolchains, cquery, select(), config transitions label Sep 21, 2026

This branch has not been deployed

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

Labels

awaiting-review PR is awaiting review from an assigned reviewer community-reviewed Reviewed by a trusted community contributor team-Configurability platforms, toolchains, cquery, select(), config transitions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants