Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. PiperOrigin-RevId: 558940840 Change-Id: I07402f203b5f11bf448a1ae9e9ee4637ad4c536d
- Loading branch information