Intern repository mapping entries#19269
Closed
fmeum wants to merge 2 commits intobazelbuild:masterfrom
Closed
Conversation
All repositories generated by a module extension have the same repository mapping entries. Without interning, if a module extension generates N repositories, each such repository would have its own copy with (more than) N entries, resulting in memory usage that is quadratic in N. We intern the entries, not the RepositoryMapping itself, because the latter also includes the owner repo, which differs between extension repos. Output of `bazel info used-heap-size-after-gc` after running a build with a synthetic module extension generating N + 1 repos: before N=100: 32MB N=1000: 77MB N=3000: 371MB N=5000: 961MB N=10000: 3614MB after N=100: 32MB N=1000: 44MB N=3000: 71MB N=5000: 91MB N=10000: 158MB
Collaborator
Author
Collaborator
Author
|
@bazel-io flag |
Wyverald
approved these changes
Aug 17, 2023
Member
Wyverald
left a comment
There was a problem hiding this comment.
nice, thank you for the investigation and prompt fix!
Member
|
@bazel-io fork 6.4.0 |
Member
|
@fmeum I accidentally clicked on "Update branch" button, causing a merge commit to be made. Can you please reset to the original commit? My apologies. cc: @bazelbuild/triage |
Member
|
@iancha1992 I think you are still able to import the PR, you can fix the GIT_AUTHORS manually, I can help review ;) |
bazel-io
pushed a commit
to bazel-io/bazel
that referenced
this pull request
Aug 22, 2023
All repositories generated by a module extension have the same repository mapping entries. Without interning, if a module extension generates N repositories, each such repository would have its own copy with (more than) N entries, resulting in overall memory usage quadratic in N. We intern the entries, not the `RepositoryMapping` itself, since the latter also includes the owner repo, which differs between extension repos. Output of `bazel info used-heap-size-after-gc` after running a build with a synthetic module extension generating N + 1 repos and requesting all of them: ``` before N=100: 32MB N=1000: 77MB N=3000: 371MB N=5000: 961MB N=10000: 3614MB after N=100: 32MB N=1000: 44MB N=3000: 71MB N=5000: 91MB N=10000: 158MB ``` Closes bazelbuild#19269. PiperOrigin-RevId: 558940840 Change-Id: I07402f203b5f11bf448a1ae9e9ee4637ad4c536d
iancha1992
pushed a commit
that referenced
this pull request
Aug 22, 2023
All repositories generated by a module extension have the same repository mapping entries. Without interning, if a module extension generates N repositories, each such repository would have its own copy with (more than) N entries, resulting in overall memory usage quadratic in N. We intern the entries, not the `RepositoryMapping` itself, since the latter also includes the owner repo, which differs between extension repos. Output of `bazel info used-heap-size-after-gc` after running a build with a synthetic module extension generating N + 1 repos and requesting all of them: ``` before N=100: 32MB N=1000: 77MB N=3000: 371MB N=5000: 961MB N=10000: 3614MB after N=100: 32MB N=1000: 44MB N=3000: 71MB N=5000: 91MB N=10000: 158MB ``` Closes #19269. Commit 74aadb2 PiperOrigin-RevId: 558940840 Change-Id: I07402f203b5f11bf448a1ae9e9ee4637ad4c536d Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
Member
|
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. |
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.
All repositories generated by a module extension have the same repository mapping entries. Without interning, if a module extension generates N repositories, each such repository would have its own copy with (more than) N entries, resulting in overall memory usage quadratic in N.
We intern the entries, not the
RepositoryMappingitself, since the latter also includes the owner repo, which differs between extension repos.Output of
bazel info used-heap-size-after-gcafter running a build with a synthetic module extension generating N + 1 repos and requesting all of them: