Rollup of 3 perf-sensitive pull requests - #162183
Conversation
Empty token streams are common. Every one causes an allocation for the `Arc::new()`. We can instead have a single shared empty `TokenStream` and `AttrTokenStream`.
…jackh726 Store LiveLoans more densely packed `LiveLoans` originally used `SparseBitMatrix<PointIndex, BorrowIndex>` in a way that didn't use "the sparseness" very effectively. The borrow dimension is usually very low (<10 bits 90% of the time), while the point dimension is typically order of magnitude higher. This means that we used to allocate a bunch of 32-byte `DenseBitSet`s that only point to a few bits in heap-allocated `u64`. We only saved some memory by not allocating the whole `PointIndex` range, but we still often need to allocatate most of it. This PR changes the representation to use a single flat representation with `GrowableBitSet` storing all bits in a single Vec. There's still a room for improvement but this should be a positive step forward. r? lqd
…lcnr Reduce next-solver memory usage by interning CanonicalQueryInput Goal: Reduce memory usage of next-solver especially when exceeding recursion limit Changes: - Added Interner::CanonicalInput associated type and surrounding interning machinery (mostly copied from ExternalConstraints) - Changed Cx::Input to be I:CanonicalInput and adjusted other places in the code to match, including calling the interning during canonicalize_goal Results: According to Heaptrack (and btop) peak memory usage for compiling `bevy_render` (like rust-lang#161748) with next-solver enabled was reduced from ~15GiB to ~4GiB since most of it was the HashMap index for NestedGoals (and search_graph::GlobalCache), which used to be 56 bytes (IIRC), but now is a single reference thanks to Interned. Closes (maybe): rust-lang#161748 Tracking issue: rust-lang/goals#113 and rust-lang#160895 (comment) r? @lcnr
…Kobzol Optimize empty token streams Empty token streams are common. Every one causes an allocation for the `Arc::new()`. We can instead have a single shared empty `TokenStream` and `AttrTokenStream`. r? @Kobzol
This comment has been minimized.
This comment has been minimized.
Rollup of 3 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple-1 try-job: aarch64-apple-2 try-job: x86_64-mingw-1 try-job: i686-msvc-1 try-job: i686-msvc-2
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 59dabe5 (parent) -> 824336a (this PR) Test differencesNo test diffs found Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 824336ad4127ce295849937a24c08a4aeff6ada7 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
📌 Perf builds for each rolled up PR:
parent commit: 59dabe56f7 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
|
Finished benchmarking commit (824336a): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Our benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -1.9%, secondary -0.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.5%, secondary -0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 473.905s -> 473.106s (-0.17%) |
|
@rust-timer triage a9c8aa3 cd59165 2d373c0 |
Running triage with 26 benchmarksTriage only executes the benchmarks on rollup members, that were changed significantly on the rollup.
#161850 a9c8aa3 Store LiveLoans more densely packedInstruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -1.7%, secondary 0.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.3%, secondary 5.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. #162031 cd59165 Reduce next-solver memory usage by interning CanonicalQueryInputInstruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary -1.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -1.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. #162047 2d373c0 Optimize empty token streamsInstruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 1.1%, secondary -3.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -3.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. |
Successful merges:
r? @ghost
Create a similar rollup