refactor(core): get_zip_runfiles_path should call startswith less by aignas · Pull Request #3442 · bazel-contrib/rules_python
Looking at the investigation in bazel-contrib#3381, it seems that we are calling the startswith many times and I wanted to see if it would be possible to optimize how it is done. I also realized that no matter what target we have, we will be calling the function once with a `__init__.py` path and we can inline this case as a separate if statement checking for equality instead, which Starlark optimizer should understand better. Before this PR for every executable target we would go through the `legacy_external_runfiles and "__init__.py".startswith("external")` and this PR eliminates this. Related to bazel-contrib#3380 and bazel-contrib#3381
aignas
deleted the
exp.aignas.get_zip_runfiles_path
branch
github-merge-queue bot pushed a commit that referenced this pull request
Feb 15, 2026This 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