-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Fix analysis time regression with Bzlmod lockfile #19970
Conversation
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!!
@bazel-io fork 7.0.0 |
Could we achieve the same result by adding Also, that would give us a convenient place to document why this is needed at all. This is important because I could certainly imagine myself later looking at this class, thinking "huh, this is a prime candidate to turn into an AutoValue", and reintroducing the performance regression. |
That's what I tried first, but ultimately decided against:
|
Just saw your edit, I will add comments and think about ways to add test coverage (seems difficult though). I could see adding comments to the classes be as effective as adding them to the |
I'm okay with skipping AutoValue altogether if we document it at the class level. I wouldn't worry about regression testing in this case. Alternatively, we could also just force-override I have a slight preference for keeping the AutoValue idiom (using |
This commit fixes a regression in analysis time caused by 19c0c80. Since `BazelModuleResolutionEvent` and `ModuleExtensionResolutionEvent` are both marked as `storeForReplay`, they are stored in a nested set for essentially all analysis phase nodes. This resulted in frequent (i.e., per target) calls to their `hashCode` methods, which are not cached and delegated to the likewise uncached methods on large `ImmutableMap` and `ImmutableTable` instances. Since there is no need for these events to be deduplicated, switching to reference equality resolves this issue. The following analysis phase measurements for a synthetic project with a single "hub and spokes" module extension and 2,000 repos illustrate the effect: * without lockfile: 4.3s * with lockfile before this commit: 8.3s * with lockfile after this commit: 4.2s
01c4b6f
to
aa6ce28
Compare
I added class comments as well as the static |
This commit fixes a regression in analysis time caused by 19c0c80. Since `BazelModuleResolutionEvent` and `ModuleExtensionResolutionEvent` are both marked as `storeForReplay`, they are stored in a nested set for essentially all analysis phase nodes. This resulted in frequent (i.e., per target) calls to their `hashCode` methods, which are not cached and delegated to the likewise uncached methods on large `ImmutableMap` and `ImmutableTable` instances. Since there is no need for these events to be deduplicated, switching to reference equality resolves this issue. The following analysis phase measurements for a synthetic project with a single "hub and spokes" module extension and 2,000 repos illustrate the effect: * without lockfile: 4.3s * with lockfile before this commit: 8.3s * with lockfile after this commit: 4.2s Fixes bazelbuild#19952 Closes bazelbuild#19970. PiperOrigin-RevId: 578734010 Change-Id: I870867c5c509389632793b0d5fe5c43ddc6176f3
This commit fixes a regression in analysis time caused by 19c0c80. Since `BazelModuleResolutionEvent` and `ModuleExtensionResolutionEvent` are both marked as `storeForReplay`, they are stored in a nested set for essentially all analysis phase nodes. This resulted in frequent (i.e., per target) calls to their `hashCode` methods, which are not cached and delegated to the likewise uncached methods on large `ImmutableMap` and `ImmutableTable` instances. Since there is no need for these events to be deduplicated, switching to reference equality resolves this issue. The following analysis phase measurements for a synthetic project with a single "hub and spokes" module extension and 2,000 repos illustrate the effect: * without lockfile: 4.3s * with lockfile before this commit: 8.3s * with lockfile after this commit: 4.2s Fixes bazelbuild#19952 Closes bazelbuild#19970. PiperOrigin-RevId: 578734010 Change-Id: I870867c5c509389632793b0d5fe5c43ddc6176f3
This commit fixes a regression in analysis time caused by 19c0c80. Since `BazelModuleResolutionEvent` and `ModuleExtensionResolutionEvent` are both marked as `storeForReplay`, they are stored in a nested set for essentially all analysis phase nodes. This resulted in frequent (i.e., per target) calls to their `hashCode` methods, which are not cached and delegated to the likewise uncached methods on large `ImmutableMap` and `ImmutableTable` instances. Since there is no need for these events to be deduplicated, switching to reference equality resolves this issue. The following analysis phase measurements for a synthetic project with a single "hub and spokes" module extension and 2,000 repos illustrate the effect: * without lockfile: 4.3s * with lockfile before this commit: 8.3s * with lockfile after this commit: 4.2s Fixes #19952 Closes #19970. Commit 435d1c2 PiperOrigin-RevId: 578734010 Change-Id: I870867c5c509389632793b0d5fe5c43ddc6176f3 Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
This commit fixes a regression in analysis time caused by 19c0c80. Since
BazelModuleResolutionEvent
andModuleExtensionResolutionEvent
are both marked asstoreForReplay
, they are stored in a nested set for essentially all analysis phase nodes. This resulted in frequent (i.e., per target) calls to theirhashCode
methods, which are not cached and delegated to the likewise uncached methods on largeImmutableMap
andImmutableTable
instances.Since there is no need for these events to be deduplicated, switching to reference equality resolves this issue.
The following analysis phase measurements for a synthetic project with a single "hub and spokes" module extension and 2,000 repos illustrate the effect:
Fixes #19952