Skip to content

Conversation

@fmeum
Copy link
Collaborator

@fmeum fmeum commented Jan 7, 2026

Followup to #28173 that reduces the overhead of builtins restriction checks from 3% to 1% by caching allowlist creation and checking per package.

fmeum added 2 commits January 7, 2026 10:27
BuiltinRestriction currently accounts for 10-20% of the total CPU time for `bazel build --nobuild //src:bazel`. This is improved by avoiding the repeated creation of "non-visible" `RepositoryName` objects, which trigger a `SpellChecker` computation. Instead, the apparent repo names, which are in fact either module names or legacy WORKSPACE repo names that no longer matter in Bazel 9 and later, are turned into canonical repo name prefixes by appending a `+`.

Note that there is still overhead in the 2-3% range even after this change due to repeated linear searches as well as repeated recreations of allowlists in the `check_private_api` C++ Starlark API.
@fmeum fmeum marked this pull request as ready for review January 7, 2026 14:44
@fmeum fmeum requested review from a team and lberki as code owners January 7, 2026 14:44
@fmeum fmeum requested review from Wyverald and dabanki and removed request for a team and dabanki January 7, 2026 14:44
@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 Jan 7, 2026
@fmeum
Copy link
Collaborator Author

fmeum commented Jan 8, 2026

@Wyverald Performance regressions of this magnitude have resulted in rollbacks in the past, so this may or may not be considered blocking for the 9.0.0 release.

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