Skip to content

[do not merge] Hashbrown code size optimization #87233

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 1 commit into from

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Jul 17, 2021

Let's see if the 20% reduction in compile time for the hashbrown test crate with my size-opt branch translates into any improvements to rustc's compile time.

r? @Amanieu

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 17, 2021
@cjgillot
Copy link
Contributor

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

bors commented Jul 17, 2021

⌛ Trying commit f081421 with merge 228e3a77bfa70ec4f62f8a025c9063885b0c329a...

@bors
Copy link
Collaborator

bors commented Jul 18, 2021

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

@rust-timer
Copy link
Collaborator

Queued 228e3a77bfa70ec4f62f8a025c9063885b0c329a with parent c7331d6, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (228e3a77bfa70ec4f62f8a025c9063885b0c329a): comparison url.

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

  • Moderate improvement in instruction counts (up to -3.1% on full builds of cargo-opt)
  • Moderate regression in instruction counts (up to 1.5% on incr-full builds of unused-warnings-check)

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 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 Jul 18, 2021
@Zoxc Zoxc closed this Jul 18, 2021
bors added a commit to rust-lang/hashbrown that referenced this pull request Jul 21, 2021
Inline small functions

This adds `#[inline]` to small functions which should be beneficial to inline.

rustc compilation performance (code size of `rustc_driver` up by 0.09%):
```
clap:check                        1.9486s   1.9416s  -0.36%
hashmap-instances:check           0.0629s   0.0626s  -0.52%
helloworld:check                  0.0443s   0.0439s  -0.69%
hyper:check                       0.3011s   0.3000s  -0.36%
regex:check                       1.1505s   1.1468s  -0.33%
syn:check                         1.6989s   1.6904s  -0.50%
syntex_syntax:check               6.8479s   6.8288s  -0.28%
winapi:check                      8.3437s   8.2967s  -0.56%

Total                            20.3979s  20.3108s  -0.43%
Summary                           4.0000s   3.9820s  -0.45%
```

This is the effect on compile time this has on my [HashMap compile time benchmark](#277 (comment)):
```
hashmap-instances:check           0.0635s   0.0632s  -0.33%
hashmap-instances:release        32.0928s  32.4440s  +1.09%
hashmap-instances:debug           7.2193s   7.2800s  +0.84%

Total                            39.3756s  39.7873s  +1.05%
Summary                           1.5000s   1.5080s  +0.54%
```

We saw a 1.6% improvement in rustc's build time for a -20% improvement on `hashmap-instances:release` on rust-lang/rust#87233. So I would expect around a 0.08% regression for rustc's build time from this PR.
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.

7 participants