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

Modify the buffer position directly when reading leb128 values. #92631

Closed
wants to merge 1 commit into from

Conversation

nnethercote
Copy link
Contributor

It's a small but clear performance win.

r? @michaelwoerister

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 6, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 6, 2022
@nnethercote
Copy link
Contributor 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 Jan 6, 2022
@bors
Copy link
Contributor

bors commented Jan 6, 2022

⌛ Trying commit 5f549d9 with merge 50c7ddde3ce168b8c3ba9a790e49d8df73d08fdd...

@bors
Copy link
Contributor

bors commented Jan 7, 2022

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

@rust-timer
Copy link
Collaborator

Queued 50c7ddde3ce168b8c3ba9a790e49d8df73d08fdd with parent cfa4ac6, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (50c7ddde3ce168b8c3ba9a790e49d8df73d08fdd): comparison url.

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

  • Small improvement in instruction counts (up to -1.0% on incr-unchanged builds of ucd)

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 Jan 7, 2022
@nnethercote
Copy link
Contributor Author

The CI results show universal instruction count improvements, but they are smaller than what I saw locally, and spread differently across the benchmarks. Here are the top 10 check results on CI:

Benchmark & Profile Scenario % Change Significance Factor
ucd check incr-unchanged -1.03%? 2.46x
tuple-stress check incr-unchanged -1.00% 14.85x
coercions check incr-unchanged -0.64% 6.49x
coercions check incr-patched: println -0.58% 5.73x
html5ever check incr-patched: println -0.52%? 2.08x
tokio-webpush-simple check full -0.35% 1.99x
webrender-wrench check incr-unchanged -0.34% 1.74x
wg-grammar check incr-unchanged -0.33% 1.93x
tokio-webpush-simple check incr-full -0.27% 1.69x
regex check incr-patched: Job -0.27% 1.51x

And here they from my local measurements (where I only did check builds):

Benchmark & Profile Scenario % Change Significance Factor
helloworld check full -1.91% 9.56x
issue-46449 check incr-unchanged -1.86% 9.30x
issue-46449 check incr-patched: u8 3072 -1.74% 8.68x
helloworld check incr-full -1.72% 8.62x
helloworld check incr-unchanged -1.69% 8.43x
deeply-nested check incr-unchanged -1.60% 8.02x
deeply-nested-closures check incr-unchanged -1.57% 7.87x
await-call-tree check incr-unchanged -1.55% 7.74x
helloworld check incr-patched: println -1.54% 7.72x
issue-46449 check full -1.53% 7.63x

I feel like the match-ups between my local measurements and CI measurements are much weaker than they used to be. I wonder if that's because I don't do PGO locally.

@michaelwoerister
Copy link
Member

Thanks, @nnethercote! Looks good to me.

@bors r+

I wonder if that's because I don't do PGO locally.

Yeah, I suspect that that plays into it.

@bors
Copy link
Contributor

bors commented Jan 7, 2022

📌 Commit 5f549d9 has been approved by michaelwoerister

@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 7, 2022
@michaelwoerister
Copy link
Member

I just saw that #92604 already includes the changes in this PR. Let's take that instead.

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 7, 2022
@michaelwoerister
Copy link
Member

Closing in favor of #92604

@nnethercote nnethercote deleted the leb128-position branch January 9, 2022 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants