-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panic directly in Arguments::new* instead of recursing #117804
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Panic directly in Arguments::new* instead of recursing This has been bothering me because it looks very silly in MIR. Maybe the simpler form is faster? It surely inlines more... but is that good? r? `@ghost`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (3f1c95e): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 674.031s -> 673.733s (-0.04%) |
ca211ea
to
28561aa
Compare
@bors try @rust-timer queue |
Panic directly in Arguments::new* instead of recursing This has been bothering me because it looks very silly in MIR. Maybe the simpler form is faster? It surely inlines more... but is that good? r? `@ghost`
☀️ Try build successful - checks-actions |
28561aa
to
84a3671
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Panic directly in Arguments::new* instead of recursing This has been bothering me because it looks very silly in MIR.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (7121f46): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 668.884s -> 667.893s (-0.15%) |
This comment has been minimized.
This comment has been minimized.
r-l-a reported the wrong chunk:
@joboet how should I abort in a |
Ah, I see... then how about |
e2c1008
to
bff3625
Compare
Some changes occurred in src/tools/cargo cc @ehuss |
bff3625
to
75f3cef
Compare
Accidentally snagged a submodule change in my haste. |
Thank you! |
@@ -340,7 +340,9 @@ impl<'a> Arguments<'a> { | |||
#[rustc_const_unstable(feature = "const_fmt_arguments_new", issue = "none")] | |||
pub const fn new_const(pieces: &'a [&'static str]) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason it can't be
pub const fn new_const(pieces: &'a [&'static str]) -> Self { | |
pub const fn new_const(pieces: &'a [&'static str; 1]) -> Self { |
eliminating the "runtime" check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function currently is called with references to arrays of length 1 and 0. This is a decent idea, but at least it would require some amount of surgery on the format_args!
expansion code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right, I overlooked 0 being valid as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about then?
pub const fn new_const(pieces: &'a [&'static str]) -> Self { | |
pub const fn new_const<const N: usize>(pieces: &'a [&'static str; N]) -> Self { |
After monomorphization the check should be eliminat-able this way, though I suspect this function is probably small enough to be probably always inlined anyways, making this point moot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hunh. That's a really good idea.
☀️ Test successful - checks-actions |
Finished benchmarking commit (606afbb): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (primary -0.7%, secondary -5.6%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary -3.3%, secondary -2.5%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary -0.1%, secondary -0.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 673.733s -> 672.526s (-0.18%) |
@rustbot label: +perf-regression-triaged No cycles regressions. The small bit of jitter was expected based on poking the size of a common function's MIR. The 7 |
…t, r=<try> Move the checks for Arguments constructors to inline const Thanks `@Skgland` for pointing out this opportunity: rust-lang#117804 (comment)
…t, r=joboet Move the checks for Arguments constructors to inline const Thanks `@Skgland` for pointing out this opportunity: rust-lang#117804 (comment)
…t, r=joboet Move the checks for Arguments constructors to inline const Thanks `@Skgland` for pointing out this opportunity: rust-lang#117804 (comment)
Move the checks for Arguments constructors to inline const Thanks `@Skgland` for pointing out this opportunity: rust-lang/rust#117804 (comment)
Move the checks for Arguments constructors to inline const Thanks `@Skgland` for pointing out this opportunity: rust-lang/rust#117804 (comment)
This has been bothering me because it looks very silly in MIR.