-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bazel query --output streamed_proto regression in 7.0.0 #20613
Comments
@bazel-io flag |
Could you try |
@Wyverald nice adding that seems to fix things!
|
@bazel-io fork 7.0.1 |
During `bazel query`, `Label#getDisplayForm(mainRepoMapping)` might be called many many times. We can optimize for that case without sacrificing too much memory by computing a reverse mapping for the main repo mapping only. Fixes #20613. Closes #20617. PiperOrigin-RevId: 592297440 Change-Id: Iaaa709a51fe39556f03408080c1fe5e73689b761
During `bazel query`, `Label#getDisplayForm(mainRepoMapping)` might be called many many times. We can optimize for that case without sacrificing too much memory by computing a reverse mapping for the main repo mapping only. Fixes bazelbuild#20613. Closes bazelbuild#20617. PiperOrigin-RevId: 592607904 Change-Id: Iaaa709a51fe39556f03408080c1fe5e73689b761
) During `bazel query`, `Label#getDisplayForm(mainRepoMapping)` might be called many many times. We can optimize for that case without sacrificing too much memory by computing a reverse mapping for the main repo mapping only. Fixes #20613. Closes #20617. Commit d9169ab PiperOrigin-RevId: 592607904 Change-Id: Iaaa709a51fe39556f03408080c1fe5e73689b761 Co-authored-by: Googler <wyv@google.com>
@bazel-io fork 7.1.0 |
During `bazel query`, `Label#getDisplayForm(mainRepoMapping)` might be called many many times. We can optimize for that case without sacrificing too much memory by computing a reverse mapping for the main repo mapping only. Fixes bazelbuild#20613. Closes bazelbuild#20617. PiperOrigin-RevId: 592607904 Change-Id: Iaaa709a51fe39556f03408080c1fe5e73689b761
) During `bazel query`, `Label#getDisplayForm(mainRepoMapping)` might be called many many times. We can optimize for that case without sacrificing too much memory by computing a reverse mapping for the main repo mapping only. Fixes #20613. Closes #20617. Commit d9169ab PiperOrigin-RevId: 592607904 Change-Id: Iaaa709a51fe39556f03408080c1fe5e73689b761 Co-authored-by: Googler <wyv@google.com> Co-authored-by: Ian (Hee) Cha <heec@google.com> Co-authored-by: Xùdōng Yáng <wyverald@gmail.com>
A fix for this issue has been included in Bazel 7.0.1 RC2. Please test out the release candidate and report any issues as soon as possible. Thanks! |
Description of the bug:
While updating to Bazel
7.0.0
from6.3.2
I observed a large slowdown for our bazel query (from ~1min to ~20min). We use bazel query for finding affected targets (similar to what some open source solutions do like https://github.com/bazel-contrib/target-determinator or https://github.com/Tinder/bazel-diff).Profiling (see reproduction steps below) yields following:
Which in turn leads us to following call-site
bazel/src/main/java/com/google/devtools/build/lib/cmdline/RepositoryName.java
Lines 272 to 275 in 2a2def8
getNameWithAt();
) and recompile from source the regression goes away.What's causing this regression for us? We implemented our own multiversion support for JVM (java and kotlin) and each multiversion is represented as a separate external repository causing proliferation and O(N * M) behavior here (we have 1000s of versions sadly).
Which category does this issue belong to?
Performance
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I wrote this quickly to repro from scratch, appologies for quality :-)
repro.sh
Now we can
cd /tmp/repro_repo/
and runbazel query --output streamed_proto "//external:all-targets + deps(//...:all-targets)" --keep_going --enable_bzlmod --experimental_command_profile &> /dev/null
Which operating system are you running Bazel on?
Mac OSX / Linux
What is the output of
bazel info release
?release 7.0.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
This is a regression when enabling bzlmod I think, it's probably not important to find the exact commit.
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: