Reduce next-solver memory usage by interning CanonicalQueryInput - #162031
Reduce next-solver memory usage by interning CanonicalQueryInput#162031laundmo wants to merge 2 commits into
Conversation
|
Thanks for the pull request, and welcome! The Rust Project has assigned @lcnr (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions and our LLM policy for more information. |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Reduce next-solver memory usage by interning CanonicalQueryInput
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (9d1834c): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never rustc-perf 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.1%, secondary 0.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -1.9%, secondary 10.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. Bootstrap: 477.635s -> 478.315s (0.14%) |
Goal: Reduce memory usage of next-solver especially when exceeding recursion limit
Changes:
Results:
According to Heaptrack (and btop) peak memory usage for compiling
bevy_render(like #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): #161748
Tracking issue: rust-lang/goals#113 and #160895 (comment)
r? @lcnr