Repository navigation
Shrink PartialRes and its alignment - #163916
Conversation
A couple of places store `NodeMap<PartialRes>`, which is `FxHashMap<NodeId, PartialRes>`, which stores `(NodeId, PartialRes)`. `(NodeId, PartialRes)` takes up 32 bytes. `PartialRes` contains a `usize` count of unresolved segments, in *that* path. We don't need room for more than 2^32 unresolved segments, so store it as a u32. That shrinks `PartialRes` and reduces its alignment, so `(NodeId, PartialRes)` shrinks to 20 bytes. We store a *lot* of those. For aws-sdk-ec2 (full check), this reduces max-rss by ~102 MiB (1.84%)
|
r? @oli-obk rustbot has assigned @oli-obk. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@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.
Shrink `PartialRes` and its alignment
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (7035dc6): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -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 -0.8%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.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: 489.893s -> 489.532s (-0.07%) |
|
Nice! r? me @bors r+ |
Shrink `PartialRes` and its alignment A couple of places store `NodeMap<PartialRes>`, which is `FxHashMap<NodeId, PartialRes>`, which stores `(NodeId, PartialRes)`. `(NodeId, PartialRes)` takes up 32 bytes. `PartialRes` contains a `usize` count of unresolved segments, in *that* path. We don't need room for more than 2^32 unresolved segments, so store it as a u32. That shrinks `PartialRes` and reduces its alignment, so `(NodeId, PartialRes)` shrinks to 20 bytes. We store a *lot* of those. For aws-sdk-ec2 (full check), this reduces max-rss by ~102 MiB (1.84%)
…uwer Rollup of 25 pull requests Successful merges: - #163090 (Run LLDB debuginfo tests on `x86_64-pc-windows-msvc` in CI) - #163806 (even more `tests/crashes` migration for `-Znext-solver`) - #162156 (add IBM f128 type) - #163508 (Document the `rustc_on_unimplemented` attribute.) - #163794 (Use `target_family = "wasm"` instead of `target_arch = "wasm32"`) - #163863 (use the type name instead of `Self` in constructor paths again) - #163864 (Remove CLAUDE.md) - #163877 (Add regression test for duplicated rustdoc search results between std and core) - #163916 (Shrink `PartialRes` and its alignment) - #149753 (On name resolution error in parameter list, suggest possible `const` typo and avoid unnecessary second error) - #152557 (Oneshot `is_ready`) - #157273 (Stabilize `optimize` attribute) - #162000 (peel_transparent_wrappers only works on non-1ZST) - #163257 (abby DSL: sanity checks on forall where clauses) - #163343 (`unit` and `[1 x unit]` layouts are incompatible on big-endian targets) - #163348 (perf:cache FFI safety results in improper_ctypes lint) - #163768 (Move more `rustdoc-html` tests in the right location) - #163778 (check is_indirect_first_projection when replacing in RefProp) - #163789 (cg_llvm: Avoid `as_c_char_ptr` in several places) - #163807 (Add `has_reliable_f16b` for Arm) - #163809 (Switch TLS implementation for wasi and bump SDK version to 34) - #163826 (Update books) - #163849 (ci: update to PowerShell 7.6.6) - #163869 (INSTALL.md: use UCRT64 instead of MINGW64 in MSYS2 section) - #163870 (Add if-installed:auto:spellcheck to pre-push script)
Shrink `PartialRes` and its alignment A couple of places store `NodeMap<PartialRes>`, which is `FxHashMap<NodeId, PartialRes>`, which stores `(NodeId, PartialRes)`. `(NodeId, PartialRes)` takes up 32 bytes. `PartialRes` contains a `usize` count of unresolved segments, in *that* path. We don't need room for more than 2^32 unresolved segments, so store it as a u32. That shrinks `PartialRes` and reduces its alignment, so `(NodeId, PartialRes)` shrinks to 20 bytes. We store a *lot* of those. For aws-sdk-ec2 (full check), this reduces max-rss by ~102 MiB (1.84%)
…uwer Rollup of 24 pull requests Successful merges: - #163090 (Run LLDB debuginfo tests on `x86_64-pc-windows-msvc` in CI) - #163806 (even more `tests/crashes` migration for `-Znext-solver`) - #163508 (Document the `rustc_on_unimplemented` attribute.) - #163794 (Use `target_family = "wasm"` instead of `target_arch = "wasm32"`) - #163863 (use the type name instead of `Self` in constructor paths again) - #163864 (Remove CLAUDE.md) - #163877 (Add regression test for duplicated rustdoc search results between std and core) - #163916 (Shrink `PartialRes` and its alignment) - #149753 (On name resolution error in parameter list, suggest possible `const` typo and avoid unnecessary second error) - #152557 (Oneshot `is_ready`) - #157273 (Stabilize `optimize` attribute) - #162000 (peel_transparent_wrappers only works on non-1ZST) - #163257 (abby DSL: sanity checks on forall where clauses) - #163343 (`unit` and `[1 x unit]` layouts are incompatible on big-endian targets) - #163348 (perf:cache FFI safety results in improper_ctypes lint) - #163768 (Move more `rustdoc-html` tests in the right location) - #163778 (check is_indirect_first_projection when replacing in RefProp) - #163789 (cg_llvm: Avoid `as_c_char_ptr` in several places) - #163807 (Add `has_reliable_f16b` for Arm) - #163809 (Switch TLS implementation for wasi and bump SDK version to 34) - #163826 (Update books) - #163849 (ci: update to PowerShell 7.6.6) - #163869 (INSTALL.md: use UCRT64 instead of MINGW64 in MSYS2 section) - #163870 (Add if-installed:auto:spellcheck to pre-push script)
…uwer Rollup of 24 pull requests Successful merges: - #163090 (Run LLDB debuginfo tests on `x86_64-pc-windows-msvc` in CI) - #163806 (even more `tests/crashes` migration for `-Znext-solver`) - #163508 (Document the `rustc_on_unimplemented` attribute.) - #163794 (Use `target_family = "wasm"` instead of `target_arch = "wasm32"`) - #163863 (use the type name instead of `Self` in constructor paths again) - #163864 (Remove CLAUDE.md) - #163877 (Add regression test for duplicated rustdoc search results between std and core) - #163916 (Shrink `PartialRes` and its alignment) - #149753 (On name resolution error in parameter list, suggest possible `const` typo and avoid unnecessary second error) - #152557 (Oneshot `is_ready`) - #157273 (Stabilize `optimize` attribute) - #162000 (peel_transparent_wrappers only works on non-1ZST) - #163257 (abby DSL: sanity checks on forall where clauses) - #163343 (`unit` and `[1 x unit]` layouts are incompatible on big-endian targets) - #163348 (perf:cache FFI safety results in improper_ctypes lint) - #163768 (Move more `rustdoc-html` tests in the right location) - #163778 (check is_indirect_first_projection when replacing in RefProp) - #163789 (cg_llvm: Avoid `as_c_char_ptr` in several places) - #163807 (Add `has_reliable_f16b` for Arm) - #163809 (Switch TLS implementation for wasi and bump SDK version to 34) - #163826 (Update books) - #163849 (ci: update to PowerShell 7.6.6) - #163869 (INSTALL.md: use UCRT64 instead of MINGW64 in MSYS2 section) - #163870 (Add if-installed:auto:spellcheck to pre-push script)
…uwer Rollup of 24 pull requests Successful merges: - #163090 (Run LLDB debuginfo tests on `x86_64-pc-windows-msvc` in CI) - #163806 (even more `tests/crashes` migration for `-Znext-solver`) - #163508 (Document the `rustc_on_unimplemented` attribute.) - #163794 (Use `target_family = "wasm"` instead of `target_arch = "wasm32"`) - #163863 (use the type name instead of `Self` in constructor paths again) - #163864 (Remove CLAUDE.md) - #163877 (Add regression test for duplicated rustdoc search results between std and core) - #163916 (Shrink `PartialRes` and its alignment) - #149753 (On name resolution error in parameter list, suggest possible `const` typo and avoid unnecessary second error) - #152557 (Oneshot `is_ready`) - #157273 (Stabilize `optimize` attribute) - #162000 (peel_transparent_wrappers only works on non-1ZST) - #163257 (abby DSL: sanity checks on forall where clauses) - #163343 (`unit` and `[1 x unit]` layouts are incompatible on big-endian targets) - #163348 (perf:cache FFI safety results in improper_ctypes lint) - #163768 (Move more `rustdoc-html` tests in the right location) - #163778 (check is_indirect_first_projection when replacing in RefProp) - #163789 (cg_llvm: Avoid `as_c_char_ptr` in several places) - #163807 (Add `has_reliable_f16b` for Arm) - #163809 (Switch TLS implementation for wasi and bump SDK version to 34) - #163826 (Update books) - #163849 (ci: update to PowerShell 7.6.6) - #163869 (INSTALL.md: use UCRT64 instead of MINGW64 in MSYS2 section) - #163870 (Add if-installed:auto:spellcheck to pre-push script)
…uwer Rollup of 24 pull requests Successful merges: - #163090 (Run LLDB debuginfo tests on `x86_64-pc-windows-msvc` in CI) - #163806 (even more `tests/crashes` migration for `-Znext-solver`) - #163508 (Document the `rustc_on_unimplemented` attribute.) - #163794 (Use `target_family = "wasm"` instead of `target_arch = "wasm32"`) - #163863 (use the type name instead of `Self` in constructor paths again) - #163864 (Remove CLAUDE.md) - #163877 (Add regression test for duplicated rustdoc search results between std and core) - #163916 (Shrink `PartialRes` and its alignment) - #149753 (On name resolution error in parameter list, suggest possible `const` typo and avoid unnecessary second error) - #152557 (Oneshot `is_ready`) - #157273 (Stabilize `optimize` attribute) - #162000 (peel_transparent_wrappers only works on non-1ZST) - #163257 (abby DSL: sanity checks on forall where clauses) - #163343 (`unit` and `[1 x unit]` layouts are incompatible on big-endian targets) - #163348 (perf:cache FFI safety results in improper_ctypes lint) - #163768 (Move more `rustdoc-html` tests in the right location) - #163778 (check is_indirect_first_projection when replacing in RefProp) - #163789 (cg_llvm: Avoid `as_c_char_ptr` in several places) - #163807 (Add `has_reliable_f16b` for Arm) - #163809 (Switch TLS implementation for wasi and bump SDK version to 34) - #163826 (Update books) - #163849 (ci: update to PowerShell 7.6.6) - #163869 (INSTALL.md: use UCRT64 instead of MINGW64 in MSYS2 section) - #163870 (Add if-installed:auto:spellcheck to pre-push script)
…uwer Rollup of 23 pull requests Successful merges: - #163090 (Run LLDB debuginfo tests on `x86_64-pc-windows-msvc` in CI) - #163806 (even more `tests/crashes` migration for `-Znext-solver`) - #163508 (Document the `rustc_on_unimplemented` attribute.) - #163794 (Use `target_family = "wasm"` instead of `target_arch = "wasm32"`) - #163863 (use the type name instead of `Self` in constructor paths again) - #163864 (Remove CLAUDE.md) - #163877 (Add regression test for duplicated rustdoc search results between std and core) - #163916 (Shrink `PartialRes` and its alignment) - #149753 (On name resolution error in parameter list, suggest possible `const` typo and avoid unnecessary second error) - #152557 (Oneshot `is_ready`) - #157273 (Stabilize `optimize` attribute) - #162000 (peel_transparent_wrappers only works on non-1ZST) - #163343 (`unit` and `[1 x unit]` layouts are incompatible on big-endian targets) - #163348 (perf:cache FFI safety results in improper_ctypes lint) - #163768 (Move more `rustdoc-html` tests in the right location) - #163778 (check is_indirect_first_projection when replacing in RefProp) - #163789 (cg_llvm: Avoid `as_c_char_ptr` in several places) - #163807 (Add `has_reliable_f16b` for Arm) - #163809 (Switch TLS implementation for wasi and bump SDK version to 34) - #163826 (Update books) - #163849 (ci: update to PowerShell 7.6.6) - #163869 (INSTALL.md: use UCRT64 instead of MINGW64 in MSYS2 section) - #163870 (Add if-installed:auto:spellcheck to pre-push script)
Rollup merge of #163916 - joshtriplett:partialres-shrink, r=lqd Shrink `PartialRes` and its alignment A couple of places store `NodeMap<PartialRes>`, which is `FxHashMap<NodeId, PartialRes>`, which stores `(NodeId, PartialRes)`. `(NodeId, PartialRes)` takes up 32 bytes. `PartialRes` contains a `usize` count of unresolved segments, in *that* path. We don't need room for more than 2^32 unresolved segments, so store it as a u32. That shrinks `PartialRes` and reduces its alignment, so `(NodeId, PartialRes)` shrinks to 20 bytes. We store a *lot* of those. For aws-sdk-ec2 (full check), this reduces max-rss by ~102 MiB (1.84%)
…uwer Rollup of 23 pull requests Successful merges: - rust-lang/rust#163090 (Run LLDB debuginfo tests on `x86_64-pc-windows-msvc` in CI) - rust-lang/rust#163806 (even more `tests/crashes` migration for `-Znext-solver`) - rust-lang/rust#163508 (Document the `rustc_on_unimplemented` attribute.) - rust-lang/rust#163794 (Use `target_family = "wasm"` instead of `target_arch = "wasm32"`) - rust-lang/rust#163863 (use the type name instead of `Self` in constructor paths again) - rust-lang/rust#163864 (Remove CLAUDE.md) - rust-lang/rust#163877 (Add regression test for duplicated rustdoc search results between std and core) - rust-lang/rust#163916 (Shrink `PartialRes` and its alignment) - rust-lang/rust#149753 (On name resolution error in parameter list, suggest possible `const` typo and avoid unnecessary second error) - rust-lang/rust#152557 (Oneshot `is_ready`) - rust-lang/rust#157273 (Stabilize `optimize` attribute) - rust-lang/rust#162000 (peel_transparent_wrappers only works on non-1ZST) - rust-lang/rust#163343 (`unit` and `[1 x unit]` layouts are incompatible on big-endian targets) - rust-lang/rust#163348 (perf:cache FFI safety results in improper_ctypes lint) - rust-lang/rust#163768 (Move more `rustdoc-html` tests in the right location) - rust-lang/rust#163778 (check is_indirect_first_projection when replacing in RefProp) - rust-lang/rust#163789 (cg_llvm: Avoid `as_c_char_ptr` in several places) - rust-lang/rust#163807 (Add `has_reliable_f16b` for Arm) - rust-lang/rust#163809 (Switch TLS implementation for wasi and bump SDK version to 34) - rust-lang/rust#163826 (Update books) - rust-lang/rust#163849 (ci: update to PowerShell 7.6.6) - rust-lang/rust#163869 (INSTALL.md: use UCRT64 instead of MINGW64 in MSYS2 section) - rust-lang/rust#163870 (Add if-installed:auto:spellcheck to pre-push script)
A couple of places store
NodeMap<PartialRes>, which isFxHashMap<NodeId, PartialRes>, which stores(NodeId, PartialRes).(NodeId, PartialRes)takes up 32 bytes.PartialRescontains ausizecount of unresolved segments, in that path. We don't need room for more than 2^32 unresolved segments, so store it as a u32. That shrinksPartialResand reduces its alignment, so(NodeId, PartialRes)shrinks to 20 bytes.We store a lot of those.
For aws-sdk-ec2 (full check), this reduces max-rss by ~102 MiB (1.84%)