perf: store splat arg index in a single byte#158251
Conversation
And remove redundant const fn
- const, async, and unsafe functions - const generics, complex types, and where clauses (including impl Tuple)
|
@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.
perf: store splat arg index in a single byte
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (51cfa71): comparison URL. Overall result: ❌ regressions - 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 Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary -2.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 4.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 503.321s -> 509.023s (1.13%) |
|
0.1% regression on 5 primary and 0.2% on 4 secondary benchmarks seems like as good as we'll get. I'll replace #153697 with this branch once I've checked with Oli. |
|
I'm going to push these perf fixes to #153697 |
…r=oli-obk Add arg splat experiment initial tuple impl ### Description This PR is part of the argument splatting lang experiment, and FFI overloading / C++ interop project goals: - rust-lang#153629 - https://rust-lang.github.io/rust-project-goals/2026/overloading-for-ffi.html - https://rust-lang.github.io/rust-project-goals/2025h2/interop-problem-map.html Example code using existing unstable features: - https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=f42a3754a63a3d9365670e57257053d5 Discussion of implementation strategy: - [#t-lang > On overloading @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/On.20overloading/near/579590336) The PR is the initial implementation of the feature: - `splat` incomplete feature gate - `#[splat]` attribute on function arguments - Splatted function argument TypeInfo - `#[splat]` function parameter check at THIR level - splatted MIR lowering (as tupled arguments) - feature gate and UI tests for item type filtering, non-splattable arguments, splattable tuples, generics, and the "overloading at home" example - about half the diff (1100 lines) is tests and test output Once this PR merges, we can add further functionality, then test it out in interop tools. ### Perf Impact We expect a 0.1% regression on 5 primary and 0.2% regression on 4 secondary benchmarks in this PR, based on [this perf run](rust-lang#158251 (comment)). We tried a number of different ways to improve perf. Limiting splat to the 255th or lower argument is a simple hack that gives good perf, and is good enough for an experiment. This PR series already has significant perf wins in rust-lang#155223 - [0.3% perf improvement across 45 primary benchmarks](rust-lang#155223 (comment)). We're spending a small amount of that perf for the new feature in this PR. ### Out of Scope for this PR - Change codegen to de-tuple caller and callee - Better diagnostics - Full support for splatted function pointer arguments
…r=oli-obk Add arg splat experiment initial tuple impl ### Description This PR is part of the argument splatting lang experiment, and FFI overloading / C++ interop project goals: - rust-lang#153629 - https://rust-lang.github.io/rust-project-goals/2026/overloading-for-ffi.html - https://rust-lang.github.io/rust-project-goals/2025h2/interop-problem-map.html Example code using existing unstable features: - https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=f42a3754a63a3d9365670e57257053d5 Discussion of implementation strategy: - [#t-lang > On overloading @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/On.20overloading/near/579590336) The PR is the initial implementation of the feature: - `splat` incomplete feature gate - `#[splat]` attribute on function arguments - Splatted function argument TypeInfo - `#[splat]` function parameter check at THIR level - splatted MIR lowering (as tupled arguments) - feature gate and UI tests for item type filtering, non-splattable arguments, splattable tuples, generics, and the "overloading at home" example - about half the diff (1100 lines) is tests and test output Once this PR merges, we can add further functionality, then test it out in interop tools. ### Perf Impact We expect a 0.1% regression on 5 primary and 0.2% regression on 4 secondary benchmarks in this PR, based on [this perf run](rust-lang#158251 (comment)). We tried a number of different ways to improve perf. Limiting splat to the 255th or lower argument is a simple hack that gives good perf, and is good enough for an experiment. This PR series already has significant perf wins in rust-lang#155223 - [0.3% perf improvement across 45 primary benchmarks](rust-lang#155223 (comment)). We're spending a small amount of that perf for the new feature in this PR. ### Out of Scope for this PR - Change codegen to de-tuple caller and callee - Better diagnostics - Full support for splatted function pointer arguments
…r=oli-obk Add arg splat experiment initial tuple impl ### Description This PR is part of the argument splatting lang experiment, and FFI overloading / C++ interop project goals: - rust-lang#153629 - https://rust-lang.github.io/rust-project-goals/2026/overloading-for-ffi.html - https://rust-lang.github.io/rust-project-goals/2025h2/interop-problem-map.html Example code using existing unstable features: - https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=f42a3754a63a3d9365670e57257053d5 Discussion of implementation strategy: - [#t-lang > On overloading @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/On.20overloading/near/579590336) The PR is the initial implementation of the feature: - `splat` incomplete feature gate - `#[splat]` attribute on function arguments - Splatted function argument TypeInfo - `#[splat]` function parameter check at THIR level - splatted MIR lowering (as tupled arguments) - feature gate and UI tests for item type filtering, non-splattable arguments, splattable tuples, generics, and the "overloading at home" example - about half the diff (1100 lines) is tests and test output Once this PR merges, we can add further functionality, then test it out in interop tools. ### Perf Impact We expect a 0.1% regression on 5 primary and 0.2% regression on 4 secondary benchmarks in this PR, based on [this perf run](rust-lang#158251 (comment)). We tried a number of different ways to improve perf. Limiting splat to the 255th or lower argument is a simple hack that gives good perf, and is good enough for an experiment. This PR series already has significant perf wins in rust-lang#155223 - [0.3% perf improvement across 45 primary benchmarks](rust-lang#155223 (comment)). We're spending a small amount of that perf for the new feature in this PR. ### Out of Scope for this PR - Change codegen to de-tuple caller and callee - Better diagnostics - Full support for splatted function pointer arguments
…r=oli-obk Add arg splat experiment initial tuple impl ### Description This PR is part of the argument splatting lang experiment, and FFI overloading / C++ interop project goals: - rust-lang#153629 - https://rust-lang.github.io/rust-project-goals/2026/overloading-for-ffi.html - https://rust-lang.github.io/rust-project-goals/2025h2/interop-problem-map.html Example code using existing unstable features: - https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=f42a3754a63a3d9365670e57257053d5 Discussion of implementation strategy: - [#t-lang > On overloading @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/On.20overloading/near/579590336) The PR is the initial implementation of the feature: - `splat` incomplete feature gate - `#[splat]` attribute on function arguments - Splatted function argument TypeInfo - `#[splat]` function parameter check at THIR level - splatted MIR lowering (as tupled arguments) - feature gate and UI tests for item type filtering, non-splattable arguments, splattable tuples, generics, and the "overloading at home" example - about half the diff (1100 lines) is tests and test output Once this PR merges, we can add further functionality, then test it out in interop tools. ### Perf Impact We expect a 0.1% regression on 5 primary and 0.2% regression on 4 secondary benchmarks in this PR, based on [this perf run](rust-lang#158251 (comment)). We tried a number of different ways to improve perf. Limiting splat to the 255th or lower argument is a simple hack that gives good perf, and is good enough for an experiment. This PR series already has significant perf wins in rust-lang#155223 - [0.3% perf improvement across 45 primary benchmarks](rust-lang#155223 (comment)). We're spending a small amount of that perf for the new feature in this PR. ### Out of Scope for this PR - Change codegen to de-tuple caller and callee - Better diagnostics - Full support for splatted function pointer arguments
…r=oli-obk Add arg splat experiment initial tuple impl ### Description This PR is part of the argument splatting lang experiment, and FFI overloading / C++ interop project goals: - rust-lang#153629 - https://rust-lang.github.io/rust-project-goals/2026/overloading-for-ffi.html - https://rust-lang.github.io/rust-project-goals/2025h2/interop-problem-map.html Example code using existing unstable features: - https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=f42a3754a63a3d9365670e57257053d5 Discussion of implementation strategy: - [#t-lang > On overloading @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/On.20overloading/near/579590336) The PR is the initial implementation of the feature: - `splat` incomplete feature gate - `#[splat]` attribute on function arguments - Splatted function argument TypeInfo - `#[splat]` function parameter check at THIR level - splatted MIR lowering (as tupled arguments) - feature gate and UI tests for item type filtering, non-splattable arguments, splattable tuples, generics, and the "overloading at home" example - about half the diff (1100 lines) is tests and test output Once this PR merges, we can add further functionality, then test it out in interop tools. ### Perf Impact We expect a 0.1% regression on 5 primary and 0.2% regression on 4 secondary benchmarks in this PR, based on [this perf run](rust-lang#158251 (comment)). We tried a number of different ways to improve perf. Limiting splat to the 255th or lower argument is a simple hack that gives good perf, and is good enough for an experiment. This PR series already has significant perf wins in rust-lang#155223 - [0.3% perf improvement across 45 primary benchmarks](rust-lang#155223 (comment)). We're spending a small amount of that perf for the new feature in this PR. ### Out of Scope for this PR - Change codegen to de-tuple caller and callee - Better diagnostics - Full support for splatted function pointer arguments
…r=oli-obk Add arg splat experiment initial tuple impl ### Description This PR is part of the argument splatting lang experiment, and FFI overloading / C++ interop project goals: - rust-lang#153629 - https://rust-lang.github.io/rust-project-goals/2026/overloading-for-ffi.html - https://rust-lang.github.io/rust-project-goals/2025h2/interop-problem-map.html Example code using existing unstable features: - https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=f42a3754a63a3d9365670e57257053d5 Discussion of implementation strategy: - [#t-lang > On overloading @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/On.20overloading/near/579590336) The PR is the initial implementation of the feature: - `splat` incomplete feature gate - `#[splat]` attribute on function arguments - Splatted function argument TypeInfo - `#[splat]` function parameter check at THIR level - splatted MIR lowering (as tupled arguments) - feature gate and UI tests for item type filtering, non-splattable arguments, splattable tuples, generics, and the "overloading at home" example - about half the diff (1100 lines) is tests and test output Once this PR merges, we can add further functionality, then test it out in interop tools. ### Perf Impact We expect a 0.1% regression on 5 primary and 0.2% regression on 4 secondary benchmarks in this PR, based on [this perf run](rust-lang#158251 (comment)). We tried a number of different ways to improve perf. Limiting splat to the 255th or lower argument is a simple hack that gives good perf, and is good enough for an experiment. This PR series already has significant perf wins in rust-lang#155223 - [0.3% perf improvement across 45 primary benchmarks](rust-lang#155223 (comment)). We're spending a small amount of that perf for the new feature in this PR. ### Out of Scope for this PR - Change codegen to de-tuple caller and callee - Better diagnostics - Full support for splatted function pointer arguments
…r=oli-obk Add arg splat experiment initial tuple impl ### Description This PR is part of the argument splatting lang experiment, and FFI overloading / C++ interop project goals: - rust-lang#153629 - https://rust-lang.github.io/rust-project-goals/2026/overloading-for-ffi.html - https://rust-lang.github.io/rust-project-goals/2025h2/interop-problem-map.html Example code using existing unstable features: - https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=f42a3754a63a3d9365670e57257053d5 Discussion of implementation strategy: - [#t-lang > On overloading @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/On.20overloading/near/579590336) The PR is the initial implementation of the feature: - `splat` incomplete feature gate - `#[splat]` attribute on function arguments - Splatted function argument TypeInfo - `#[splat]` function parameter check at THIR level - splatted MIR lowering (as tupled arguments) - feature gate and UI tests for item type filtering, non-splattable arguments, splattable tuples, generics, and the "overloading at home" example - about half the diff (1100 lines) is tests and test output Once this PR merges, we can add further functionality, then test it out in interop tools. ### Perf Impact We expect a 0.1% regression on 5 primary and 0.2% regression on 4 secondary benchmarks in this PR, based on [this perf run](rust-lang#158251 (comment)). We tried a number of different ways to improve perf. Limiting splat to the 255th or lower argument is a simple hack that gives good perf, and is good enough for an experiment. This PR series already has significant perf wins in rust-lang#155223 - [0.3% perf improvement across 45 primary benchmarks](rust-lang#155223 (comment)). We're spending a small amount of that perf for the new feature in this PR. ### Out of Scope for this PR - Change codegen to de-tuple caller and callee - Better diagnostics - Full support for splatted function pointer arguments
Rollup merge of #153697 - teor2345:fn-arg-splat-experiment, r=oli-obk Add arg splat experiment initial tuple impl ### Description This PR is part of the argument splatting lang experiment, and FFI overloading / C++ interop project goals: - #153629 - https://rust-lang.github.io/rust-project-goals/2026/overloading-for-ffi.html - https://rust-lang.github.io/rust-project-goals/2025h2/interop-problem-map.html Example code using existing unstable features: - https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=f42a3754a63a3d9365670e57257053d5 Discussion of implementation strategy: - [#t-lang > On overloading @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/On.20overloading/near/579590336) The PR is the initial implementation of the feature: - `splat` incomplete feature gate - `#[splat]` attribute on function arguments - Splatted function argument TypeInfo - `#[splat]` function parameter check at THIR level - splatted MIR lowering (as tupled arguments) - feature gate and UI tests for item type filtering, non-splattable arguments, splattable tuples, generics, and the "overloading at home" example - about half the diff (1100 lines) is tests and test output Once this PR merges, we can add further functionality, then test it out in interop tools. ### Perf Impact We expect a 0.1% regression on 5 primary and 0.2% regression on 4 secondary benchmarks in this PR, based on [this perf run](#158251 (comment)). We tried a number of different ways to improve perf. Limiting splat to the 255th or lower argument is a simple hack that gives good perf, and is good enough for an experiment. This PR series already has significant perf wins in #155223 - [0.3% perf improvement across 45 primary benchmarks](#155223 (comment)). We're spending a small amount of that perf for the new feature in this PR. ### Out of Scope for this PR - Change codegen to de-tuple caller and callee - Better diagnostics - Full support for splatted function pointer arguments
Add arg splat experiment initial tuple impl ### Description This PR is part of the argument splatting lang experiment, and FFI overloading / C++ interop project goals: - rust-lang/rust#153629 - https://rust-lang.github.io/rust-project-goals/2026/overloading-for-ffi.html - https://rust-lang.github.io/rust-project-goals/2025h2/interop-problem-map.html Example code using existing unstable features: - https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=f42a3754a63a3d9365670e57257053d5 Discussion of implementation strategy: - [#t-lang > On overloading @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/On.20overloading/near/579590336) The PR is the initial implementation of the feature: - `splat` incomplete feature gate - `#[splat]` attribute on function arguments - Splatted function argument TypeInfo - `#[splat]` function parameter check at THIR level - splatted MIR lowering (as tupled arguments) - feature gate and UI tests for item type filtering, non-splattable arguments, splattable tuples, generics, and the "overloading at home" example - about half the diff (1100 lines) is tests and test output Once this PR merges, we can add further functionality, then test it out in interop tools. ### Perf Impact We expect a 0.1% regression on 5 primary and 0.2% regression on 4 secondary benchmarks in this PR, based on [this perf run](rust-lang/rust#158251 (comment)). We tried a number of different ways to improve perf. Limiting splat to the 255th or lower argument is a simple hack that gives good perf, and is good enough for an experiment. This PR series already has significant perf wins in rust-lang/rust#155223 - [0.3% perf improvement across 45 primary benchmarks](rust-lang/rust#155223 (comment)). We're spending a small amount of that perf for the new feature in this PR. ### Out of Scope for this PR - Change codegen to de-tuple caller and callee - Better diagnostics - Full support for splatted function pointer arguments
Add arg splat experiment initial tuple impl ### Description This PR is part of the argument splatting lang experiment, and FFI overloading / C++ interop project goals: - rust-lang/rust#153629 - https://rust-lang.github.io/rust-project-goals/2026/overloading-for-ffi.html - https://rust-lang.github.io/rust-project-goals/2025h2/interop-problem-map.html Example code using existing unstable features: - https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=f42a3754a63a3d9365670e57257053d5 Discussion of implementation strategy: - [#t-lang > On overloading @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/On.20overloading/near/579590336) The PR is the initial implementation of the feature: - `splat` incomplete feature gate - `#[splat]` attribute on function arguments - Splatted function argument TypeInfo - `#[splat]` function parameter check at THIR level - splatted MIR lowering (as tupled arguments) - feature gate and UI tests for item type filtering, non-splattable arguments, splattable tuples, generics, and the "overloading at home" example - about half the diff (1100 lines) is tests and test output Once this PR merges, we can add further functionality, then test it out in interop tools. ### Perf Impact We expect a 0.1% regression on 5 primary and 0.2% regression on 4 secondary benchmarks in this PR, based on [this perf run](rust-lang/rust#158251 (comment)). We tried a number of different ways to improve perf. Limiting splat to the 255th or lower argument is a simple hack that gives good perf, and is good enough for an experiment. This PR series already has significant perf wins in rust-lang/rust#155223 - [0.3% perf improvement across 45 primary benchmarks](rust-lang/rust#155223 (comment)). We're spending a small amount of that perf for the new feature in this PR. ### Out of Scope for this PR - Change codegen to de-tuple caller and callee - Better diagnostics - Full support for splatted function pointer arguments
|
@rustbot label +F-splat |
This is a perf test for a variation of #153697.
It's part of the splat lang experiment, tracking issue #153629.