Skip to content

Don't inline OnceCell initialization closures #89031

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

Merged
merged 1 commit into from
Sep 19, 2021

Conversation

the8472
Copy link
Member

@the8472 the8472 commented Sep 16, 2021

The more general variant of #89026, originally suggested in #86898 (comment)

@rust-highfive
Copy link
Contributor

r? @Mark-Simulacrum

(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 Sep 16, 2021
@the8472
Copy link
Member Author

the8472 commented Sep 16, 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 Sep 16, 2021
@bors
Copy link
Collaborator

bors commented Sep 16, 2021

⌛ Trying commit ca2d2fa with merge 0c1a9015e49c2d639b1c9832219d5328e7568d8d...

@bors
Copy link
Collaborator

bors commented Sep 16, 2021

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

@rust-timer
Copy link
Collaborator

Queued 0c1a9015e49c2d639b1c9832219d5328e7568d8d with parent e4828d5, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0c1a9015e49c2d639b1c9832219d5328e7568d8d): comparison url.

Summary: This change led to small relevant improvements 🎉 in compiler performance.

  • Small improvement in instruction counts (up to -0.6% on incr-unchanged builds of issue-46449)

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.

@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 Sep 17, 2021
@Mark-Simulacrum
Copy link
Member

I guess it's possible this will end up hurting performance if the initialization is actually hot (e.g., the OnceCell is guarding something that must be done only once but usually only happens once). But that seems like a relatively unlikely edge case, and the wins here are nice -- though notably primarily limited to -doc builds, which suggests that this is mostly an improvement for those compiling without PGO (like rustdoc is today). That's most Rust users though.

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 17, 2021

📌 Commit ca2d2fa 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 Sep 17, 2021
@bors
Copy link
Collaborator

bors commented Sep 19, 2021

⌛ Testing commit ca2d2fa with merge 7a3d1a5...

@bors
Copy link
Collaborator

bors commented Sep 19, 2021

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 19, 2021
@bors bors merged commit 7a3d1a5 into rust-lang:master Sep 19, 2021
@rustbot rustbot added this to the 1.57.0 milestone Sep 19, 2021
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7a3d1a5): comparison url.

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

  • Moderate improvement in instruction counts (up to -0.9% on full builds of helloworld)
  • Moderate regression in instruction counts (up to 0.7% on incr-patched: println builds of deep-vector)

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 Sep 19, 2021
@pnkfelix
Copy link
Member

Weekly perf triage. This was categorized as a regression under our old performance evaluation scheme.

However, we have revised our evaluation metrics, especially how we determine significance, and with that in place, the regression to deep-vector incr-patched: println builds are no longer considered significant in this case.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Sep 21, 2021
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants