-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Use Vec extend instead of repeated pushes on several places #91042
Conversation
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit ad94a04fa16f53a0ac69983b8e7d6bf9640453a1 with merge 76d592791c8d5353c733921c2564ffb0b6b2ed3b... |
ad94a04
to
295efcc
Compare
This comment has been minimized.
This comment has been minimized.
295efcc
to
3e9d1b9
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 3e9d1b944e9b6d599415446bf0ffc3dfe1e32718 with merge 826bfd4f40a8dcd4947f74103178fb991029a322... |
☀️ Try build successful - checks-actions |
Queued 826bfd4f40a8dcd4947f74103178fb991029a322 with parent a77da2d, future comparison URL. |
Finished benchmarking commit (826bfd4f40a8dcd4947f74103178fb991029a322): comparison url. Summary: This change led to very large relevant regressions 😿 in compiler performance.
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 @bors rollup=never |
Hmm, I could investigate the regression, but since it seems that there are no big improvements either, I wonder if it's worth it to do these changes at all? |
@Kobzol FYI perf has been very unreliable lately, so this doesn't necessarily mean your change is slower. There's a Zulip thread about it somewhere. |
r=me once the conflicts are resolved. |
3e9d1b9
to
883d0a7
Compare
@nagisa I kept only the less controversial changes and rebased. (I don't have permissions to r=you though I suppose) |
@bors r+ rollup Thanks! |
📌 Commit 883d0a7 has been approved by |
…askrgr Rollup of 5 pull requests Successful merges: - rust-lang#91042 (Use Vec extend instead of repeated pushes on several places) - rust-lang#91476 (Improve 'cannot contain emoji' error.) - rust-lang#91568 (Pretty print break and continue without redundant space) - rust-lang#91645 (Implement `core::future::join!`) - rust-lang#91666 (update Miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Use Vec extend instead of repeated pushes on several places Inspired by rust-lang#90813, I tried to use a simple regex (`for .*in.*\{\n.*push\(.*\);\n\s+}`) to search for more places that would use `Vec::push` in a loop and replace them with `Vec::extend`. These probably won't have as much perf. impact as the original PR (if any), but it would probably be better to do a perf run to see if there are not any regressions.
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#87599 (Implement concat_bytes!) - rust-lang#89999 (Update std::env::temp_dir to use GetTempPath2 on Windows when available.) - rust-lang#90796 (Remove the reg_thumb register class for asm! on ARM) - rust-lang#91042 (Use Vec extend instead of repeated pushes on several places) - rust-lang#91634 (Do not attempt to suggest help for overly malformed struct/function call) - rust-lang#91685 (Install llvm tools to sysroot when assembling local toolchain) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Inspired by #90813, I tried to use a simple regex (
for .*in.*\{\n.*push\(.*\);\n\s+}
) to search for more places that would useVec::push
in a loop and replace them withVec::extend
.These probably won't have as much perf. impact as the original PR (if any), but it would probably be better to do a perf run to see if there are not any regressions.