Skip to content

Conversation

@fmeum
Copy link
Collaborator

@fmeum fmeum commented Dec 23, 2025

BuiltinRestriction currently accounts for 9% of the total CPU time for bazel build --nobuild //src:bazel-dev. This is avoided by replacing the linear search with a sorted map lookup and avoiding the repeated creation of "non-visible" RepositoryName objects, which trigger a SpellChecker computation.

The map lookup is made possible by the transition to Bzlmod, which makes it possible to drop legacy repo names and treat the remaining apparent repo names as module names, for which it is easy to derive an unambiguous prefix of the canonical repo name.

`BuiltinRestriction` currently accounts for 9% of the total CPU time for `bazel build --nobuild //src:bazel-dev`. This is avoided by replacing the linear search with a sorted map lookup and avoiding the repeated creation of "non-visible" `RepositoryName` objects, which trigger a `SpellChecker` computation.

The map lookup is made possible by the transition to Bzlmod, which makes it possible to drop legacy repo names and treat the remaining apparent repo names as module names, for which it is easy to derive a prefix of the canonical repo name.
@fmeum
Copy link
Collaborator Author

fmeum commented Dec 23, 2025

@bazel-io fork 9.0.0

@fmeum fmeum marked this pull request as ready for review December 23, 2025 16:35
@fmeum fmeum requested review from a team and lberki as code owners December 23, 2025 16:35
@fmeum fmeum requested review from Wyverald and gregestren and removed request for a team, gregestren and lberki December 23, 2025 16:35
@github-actions github-actions bot added team-Configurability platforms, toolchains, cquery, select(), config transitions team-Rules-CPP Issues for C++ rules awaiting-review PR is awaiting review from an assigned reviewer labels Dec 23, 2025
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 team-Configurability platforms, toolchains, cquery, select(), config transitions team-Rules-CPP Issues for C++ rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant