Improve capacity estimation in Vec::from_iter by AngelicosPhosphoros · Pull Requ...
source link: https://github.com/rust-lang/rust/pull/92138
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.
Conversation
r? @kennytm
(rust-highfive has picked a reviewer for you, use r? to override)
Could someone kindly start perf after tests, please?
Awaiting bors try build completion.
@rustbot label: +S-waiting-on-perf
Try build successful - checks-actions
Build commit: d9b995d (d9b995d978da72c2e7147d41e7c4a4a8369ef452
)
Finished benchmarking commit (d9b995d): comparison url.
Summary: This change led to moderate relevant improvements in compiler performance.
- Moderate improvement in instruction counts (up to -2.5% on
incr-patched: println
builds ofregression-31157
)
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 updated PR.
I hope, this guesses are better.
May someone start perf again?
Awaiting bors try build completion.
@rustbot label: +S-waiting-on-perf
Try build successful - checks-actions
Build commit: 295c663 (295c663aa9e8675abae1f4c4781b0e4d1a10b930
)
Finished benchmarking commit (295c663): comparison url.
Summary: This change led to large relevant mixed results in compiler performance.
- Large improvement in instruction counts (up to -2.3% on
full
builds ofissue-46449
) - Small regression in instruction counts (up to 2.2% on
incr-patched: println
builds ofregression-31157
)
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
I am curious, how my PR with added code can lower instruction count? What instruction count means?
Instruction count here means how many instructions were actually executed when compiling a specific crate with specific settings (incremental/non-incremental, check/debug/opt etc.). Lower instruction count usually means faster compile times, so this is actually a good thing!
Since your change only modifies library code, the results seem to hint that it indeed sped up Vec
collection, which could translate to nice speedups not only for Rustc compile times, but also for the runtime of all Rust programs!
Oh, that's nice.
However, I wonder why walltime for match-stress-exhaustive_patterns opt
increased by 7.46% link.
Also bootstrap times increased too (maybe because there are a lot of code which collects to Vec and I increased amount of code to instantiate in each case?).
Bootstrap is a bit noisy, unless it regresses for +10% or something, it should be fine I think. Wall times are also extremely noisy in general, this one incr-unchanged
looks like noise.
Awaiting bors try build completion.
@rustbot label: +S-waiting-on-perf
Try build successful - checks-actions
Build commit: d499522 (d499522b3e906fe5c31337590db9d0564b717e42
)
Finished benchmarking commit (d499522): comparison url.
Summary: This change led to large relevant improvements in compiler performance.
- Large improvement in instruction counts (up to -2.9% on
full
builds ofissue-46449 doc
)
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
If you could summarize the perf results across the runs so that we can make an informed decision as to which variant to use, that would be good.
It seems that last results are best. They don't have any regressions unlike first perf and have better improves than second one.
changed the title Try to make some guesses about capacity in Vec::from_iter
Improve capacity estimation in Vec::from_iter
@bors r+
Thanks -- squashed the commits and approving.
Commit ea570c6 has been approved by Mark-Simulacrum
Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing 74fbbef to master...
Finished benchmarking commit (74fbbef): comparison url.
Summary: This change led to large relevant improvements in compiler performance.
- Large improvement in instruction counts (up to -3.0% on
full
builds ofprojection-caching doc
)
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.
@rustbot label: -perf-regression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK