3

Don't inline OnceCell initialization closures by the8472 · Pull Request #89031 ·...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/89031
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

Copy link

Contributor

the8472 commented 24 days ago

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

Copy link

Collaborator

rust-highfive commented 24 days ago

r? @Mark-Simulacrum

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

Copy link

Contributor

Author

the8472 commented 24 days ago

Copy link

Collaborator

rust-timer commented 24 days ago

Awaiting bors try build completion.

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

Copy link

Contributor

bors commented 24 days ago

hourglass Trying commit ca2d2fa with merge 0c1a901...

Copy link

Contributor

bors commented 24 days ago

sunny Try build successful - checks-actions
Build commit: 0c1a901 (0c1a9015e49c2d639b1c9832219d5328e7568d8d)

Copy link

Collaborator

rust-timer commented 24 days ago

Copy link

Collaborator

rust-timer commented 23 days ago

Finished benchmarking commit (0c1a901): comparison url.

Summary: This change led to small relevant improvements tada 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

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+

Copy link

Contributor

bors commented 23 days ago

pushpin Commit ca2d2fa has been approved by Mark-Simulacrum

Copy link

Contributor

bors commented 21 days ago

hourglass Testing commit ca2d2fa with merge 7a3d1a5...

Copy link

Contributor

bors commented 21 days ago

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

bors

merged commit 7a3d1a5 into

rust-lang:master 21 days ago

11 checks passed

rustbot

added this to the 1.57.0 milestone

21 days ago

Copy link

Collaborator

rust-timer commented 21 days ago

Finished benchmarking commit (7a3d1a5): comparison url.

Summary: This change led to moderate relevant mixed results shrug 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

Copy link

Member

pnkfelix commented 19 days ago

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Projects

None yet

Milestone

1.57.0

Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK