Repository navigation
perf(gazelle): look for a missing gazelle_python.yaml only once - #4481
Open
Shamsidinkhon wants to merge 3 commits into
Open
Shamsidinkhon wants to merge 3 commits into
Shamsidinkhon wants to merge 3 commits into
Conversation
Since manifests are loaded lazily (bazel-contrib#2746), `FindThirdPartyDependency` tries to load the manifest of the importing package and of each parent package every time it resolves a module name. A manifest that exists is loaded once and kept, but a missing one is looked for again on every call. In a repository where only the root has a manifest, that is an `os.Stat` per parent directory for every candidate module name of every import. To fix, the config now remembers that its manifest doesn't exist, and later calls skip it. `SetGazelleManifestPath` clears the flag, so a new path is still looked up. The generated BUILD files are unchanged.
Shamsidinkhon
requested review from
aignas,
dougthor42 and
rickeylev
as code owners
November 12, 2026 13:11
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since manifests are loaded lazily (#2746),
FindThirdPartyDependencytries to load the manifest of the importing package and of each parent package every time it resolves a module name. A manifest that exists is loaded once and kept, but a missing one is looked for again on every call. In a repository where only the root has a manifest, that is anos.Statper parent directory for every candidate module name of every import.To fix, the config now remembers that its manifest doesn't exist, and later calls skip it.
SetGazelleManifestPathclears the flag, so a new path is still looked up.The generated BUILD files are unchanged.
I wrote this change with an AI coding assistant (Claude Code) and reviewed it myself. I'll read and answer review comments personally; no agent posts on this PR.