-
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
Add profiling for Bzlmod operations #19291
Conversation
The profile shows that module resolution is much slower than it could be due to serial downloads. Maybe we can get a quick win here with a thread pool and then adopt Loom later on? |
The resolution of Bazel modules and evaluation of module extensions is now represented in the profile.
@meisterT Can anyone from the build productivity team also take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!
Could you share your profile result here? I'd love to take a look too (too many '...'s in that screenshot :)) |
|
It's interesting to see how the cyclic dependency between rules_go and gazelle contributes to the critical path. |
Yeah that's essentially a really long dependency chain. We could be smarter there -- don't bother with deps at lower versions if we know there's no multiple-version override, for example. It would make the discovery code a bit more gnarly, but anyway. |
But do note that this needs to be done very carefully, or version resolution might become nondeterministic-- if the lower version itself has higher-version deps, we need to make sure we have a deterministic way to decide which "lower version" to drop. The end result is still some set of minimal versions, but is not the original MVS. This is related to the original idea by @meteorcloudy |
(didn't mean to rerequest a review, I didn't make any changes) |
@bazel-io flag |
@bazel-io fork 6.4.0 |
The resolution of Bazel modules and evaluation of module extensions is now represented in the profile. Profile from a run of `bazel build //src:bazel-dev --enable_bzlmod --nobuild`: ![Bzlmod profile](https://github.com/bazelbuild/bazel/assets/4312191/22e03604-f832-4f64-be0e-a3281b94da3e) Closes bazelbuild#19291. PiperOrigin-RevId: 559466489 Change-Id: If0989a4a6728f8dbf659197a7acbd3a0fcef9471
@fmeum @meisterT @Wyverald @meteorcloudy I think we may need another commit before we cherry-pick this one to 6.4.0 because in |
The resolution of Bazel modules and evaluation of module extensions is now represented in the profile. Profile from a run of `bazel build //src:bazel-dev --enable_bzlmod --nobuild`: ![Bzlmod profile](https://github.com/bazelbuild/bazel/assets/4312191/22e03604-f832-4f64-be0e-a3281b94da3e) Closes #19291. Commit e7cfd2e#diff-602cd193eba2ecc3a616c8a5cb84e93d27ef4ee613d650139ff7bfa21bcee1f2 PiperOrigin-RevId: 559466489 Change-Id: If0989a4a6728f8dbf659197a7acbd3a0fcef9471 --------- Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
The changes in this PR have been included in Bazel 6.4.0 RC1. Please test out the release candidate and report any issues as soon as possible. If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=last_rc. |
The resolution of Bazel modules and evaluation of module extensions is now represented in the profile.
Profile from a run of
bazel build //src:bazel-dev --enable_bzlmod --nobuild
: