Skip to content
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

Create core::fmt::ArgumentV1 with generics instead of fn pointer #90891

Merged
merged 2 commits into from Jan 31, 2022

Conversation

nbdd0121
Copy link
Contributor

@nbdd0121 nbdd0121 commented Nov 14, 2021

Split from (and prerequisite of) #90488, as this seems to have perf implication.

@rustbot label: +T-libs

@rust-highfive
Copy link
Collaborator

r? @jackh726

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 14, 2021
@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Nov 14, 2021
@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member

jyn514 commented Nov 14, 2021

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 14, 2021
@bors
Copy link
Contributor

bors commented Nov 14, 2021

⌛ Trying commit 2d042015faeb16b8ee59c98f2338c3573d1a805e with merge e7ca218bed4617e025bc0d11d072b26351ac6b29...

@bors
Copy link
Contributor

bors commented Nov 14, 2021

☀️ Try build successful - checks-actions
Build commit: e7ca218bed4617e025bc0d11d072b26351ac6b29 (e7ca218bed4617e025bc0d11d072b26351ac6b29)

@rust-timer
Copy link
Collaborator

Queued e7ca218bed4617e025bc0d11d072b26351ac6b29 with parent b416e38, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e7ca218bed4617e025bc0d11d072b26351ac6b29): comparison url.

Summary: This change led to large relevant mixed results 🤷 in compiler performance.

  • Large improvement in instruction counts (up to -2.4% on full builds of inflate)
  • Large regression in instruction counts (up to 3.3% on full builds of tokio-webpush-simple)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking 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 led to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Nov 14, 2021
@nbdd0121
Copy link
Contributor Author

The perf run shows that this change generally improves typechecking perf of format_args! but there are seems to be some pathological cases regarding LLVM.

Manually inlining ArgumentV1::new into new_<trait> doesn't change the perf run result. Maybe adding #[inline(always)] could help.

Please queue another perf run, thanks!

@jackh726
Copy link
Member

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 15, 2021
@bors
Copy link
Contributor

bors commented Nov 15, 2021

⌛ Trying commit 1d60089fb0658e8d8fea6ce80833ea5855da18eb with merge c27884d95b11c30ef7e6320cfa2dd9772fce6b4a...

@bors
Copy link
Contributor

bors commented Nov 15, 2021

☀️ Try build successful - checks-actions
Build commit: c27884d95b11c30ef7e6320cfa2dd9772fce6b4a (c27884d95b11c30ef7e6320cfa2dd9772fce6b4a)

@rust-timer
Copy link
Collaborator

Queued c27884d95b11c30ef7e6320cfa2dd9772fce6b4a with parent ad44239, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c27884d95b11c30ef7e6320cfa2dd9772fce6b4a): comparison url.

Summary: This change led to very large relevant mixed results 🤷 in compiler performance.

  • Very large improvement in instruction counts (up to -6.0% on full builds of deeply-nested-closures)
  • Moderate regression in instruction counts (up to 1.9% on full builds of cranelift-codegen)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking 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 led to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 15, 2021
@nbdd0121 nbdd0121 changed the title [WIP] Create core::fmt::ArgumentV1 with generics instead of fn pointer Create core::fmt::ArgumentV1 with generics instead of fn pointer Nov 15, 2021
@nbdd0121
Copy link
Contributor Author

The later perf run shows that typeck is sped up in general, with some regression in debug profile codegen (which is expected, since #[inline(always)] will require LLVM to do more work). Is this regression acceptable or maybe shall I try #[inline] instead of #[inline(always)] to see the difference?

@joshtriplett
Copy link
Member

I personally think this seems reasonable, but it's worth a perf run to see how regular inline fares.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 28, 2022
@bors
Copy link
Contributor

bors commented Jan 29, 2022

⌛ Testing commit b74eca7bee74116014db6b0bf6b14dd8562dbecb with merge 8036ccf3506596b40a474f9b2ffdde9f94e08879...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jan 29, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 29, 2022
@Mark-Simulacrum
Copy link
Member

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Jan 30, 2022

📌 Commit 0d4bb0b has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 30, 2022
@bors
Copy link
Contributor

bors commented Jan 31, 2022

⌛ Testing commit 0d4bb0b with merge e58e7b1...

@bors
Copy link
Contributor

bors commented Jan 31, 2022

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing e58e7b1 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 31, 2022
@bors bors merged commit e58e7b1 into rust-lang:master Jan 31, 2022
@rustbot rustbot added this to the 1.60.0 milestone Jan 31, 2022
@rust-timer

This comment has been minimized.

@rustbot rustbot removed the perf-regression Performance regression. label Jan 31, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e58e7b1): comparison url.

Summary: This benchmark run shows 59 relevant improvements 🎉 but 14 relevant regressions 😿 to instruction counts.

  • Average relevant regression: 1.2%
  • Average relevant improvement: -1.2%
  • Largest improvement in instruction counts: -6.7% on full builds of tokio-webpush-simple opt
  • Largest regression in instruction counts: 2.1% on full builds of keccak check

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression

@rustbot rustbot added the perf-regression Performance regression. label Jan 31, 2022
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 10, 2022
Create `core::fmt::ArgumentV1` with generics instead of fn pointer

Split from (and prerequisite of) rust-lang#90488, as this seems to have perf implication.

`@rustbot` label: +T-libs
@nbdd0121 nbdd0121 deleted the format branch April 29, 2022 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet