Skip to content

[Perf Experiment] Introduce NeverShortCircuit to see if it helps fold-via-try_fold #90886

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

Closed
wants to merge 2 commits into from

Conversation

scottmcm
Copy link
Member

This was removed a while ago for compilation time reasons, but the user experience would be better if implementing just try_fold was enough to also get optimized fold -- and at the LLVM level that completely works.

Since the removal we've moved to a different Try implementation, so this PR tries adding an as-simple-as-possible repr(transparent) newtype NeverShortCircuit in hopes that will minimize any perf regressions (as it won't need to test From impls and such, like it used to back in the try_trait_v1 days).

r? @ghost

@scottmcm
Copy link
Member Author

@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 13, 2021
@bors
Copy link
Collaborator

bors commented Nov 13, 2021

⌛ Trying commit bdef2ad with merge 6f42da510ae8aeb7f33b36463a98f35e72a14d91...

@rust-log-analyzer

This comment has been minimized.

@rust-lang rust-lang deleted a comment from rust-timer Nov 14, 2021
@rust-lang rust-lang deleted a comment from rust-timer Nov 14, 2021
@scottmcm
Copy link
Member Author

@rust-timer build 6f42da510ae8aeb7f33b36463a98f35e72a14d91

@rust-timer
Copy link
Collaborator

Queued 6f42da510ae8aeb7f33b36463a98f35e72a14d91 with parent b416e38, future comparison URL.

@rust-lang rust-lang deleted a comment from rust-timer Nov 14, 2021
@rust-lang rust-lang deleted a comment from rust-timer Nov 14, 2021
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6f42da510ae8aeb7f33b36463a98f35e72a14d91): comparison url.

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

  • Moderate improvement in instruction counts (up to -0.4% on incr-unchanged builds of wg-grammar)
  • Large regression in instruction counts (up to 2.5% on incr-patched: println builds of clap-rs)

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. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Nov 14, 2021
@scottmcm
Copy link
Member Author

Hmm, mostly 0.1% regressions but a couple over 1%. Promising, but not clean enough to be obviously-fine.

Seeing 1% regressions on check builds makes me think there's an opportunity to improve that, since the implementation of a function in core really shouldn't matter for that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants