-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Use UnsafeArg in Arguments::new_v1 #89155
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
Conversation
Some changes occurred in src/tools/clippy. cc @rust-lang/clippy |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 8999391ffd611c6603d17d7c6a864086c524eac4 with merge 2d0cbf47213faa5e914df67c6ecff357704e6c60... |
This comment has been minimized.
This comment has been minimized.
8999391
to
7e7fe27
Compare
@rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
This comment has been minimized.
This comment has been minimized.
7e7fe27
to
a54bc58
Compare
@rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
@rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit a54bc5873b02d0774f787ecc381965048efb8fca with merge 05b81d65ee137dd24915e693fee7bab00f70b0d1... |
☀️ Try build successful - checks-actions |
Queued 05b81d65ee137dd24915e693fee7bab00f70b0d1 with parent 840acd3, future comparison URL. |
Finished benchmarking commit (05b81d65ee137dd24915e693fee7bab00f70b0d1): comparison url. Summary: This change led to large relevant mixed results 🤷 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 |
a54bc58
to
48aae0f
Compare
@bors try @rust-timer queue (probably should have waited for #89139 to be merged in the first place) |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
48aae0f
to
69cdb0d
Compare
Looking at the regressions in the perf run above, they're mostly down to some slight codegen time regressions. Looking at the IR generated by format_args!, though, it seems like it's pretty much the same or maybe slightly better at most -- I think the primary difference is that the UnsafeArg unsafe constructor creates an extra basic block in the MIR and LLVM IR (since My suspicion is that these are related to UnsafeArg::new being const now -- I've adjusted to just apply that change for another evaluation. @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 69cdb0d38780c849ae2dc636a464e89b4a8aa690 with merge 8d71823382b5b3f1a45de0524158120e3a504461... |
69cdb0d
to
d753e34
Compare
@bors try |
⌛ Trying commit d753e34e94a4c707e15a4cd006e02ea234ad2e5e with merge 4790386457cce89d275a3d6ec0c4cb81c71cd565... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
Queued 4790386457cce89d275a3d6ec0c4cb81c71cd565 with parent 2b6ed3b, future comparison URL. |
Finished benchmarking commit (4790386457cce89d275a3d6ec0c4cb81c71cd565): comparison url. Summary: This benchmark run did not return any relevant changes. 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 |
d753e34
to
86b42ab
Compare
@bors try @rust-timer queue Let's try the original set again, just in case. |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 86b42ab with merge b16fcaca1209afedd97a9dd4db06d5abdadac403... |
☀️ Try build successful - checks-actions |
Queued b16fcaca1209afedd97a9dd4db06d5abdadac403 with parent 8a12be7, future comparison URL. |
Finished benchmarking commit (b16fcaca1209afedd97a9dd4db06d5abdadac403): comparison url. Summary: This change led to large relevant mixed results 🤷 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 |
I believe the regressions, both in incremental and non-incremental benchmarks, are largely due to added queries checking that the UnsafeArg arguments being added are well-formed and such. That seems like a cost of this change, for sure, but one that seems not too unexpected. I don't really have an explanation for the improvements, though. It seems like they are due to a large amount of instructions in process_obligations no longer running -- but that doesn't seem like it should be tied into this patch. It might be shuffling of instructions or something into different basic blocks which causes changes to optimizers, but I have no real proof of this. They don't seem as important to investigate regardless. I am a little hesitant to proceed with accepting the regressions, particularly when it seems like they don't actually really benefit us (and indeed the API is "needlessly" made unsafe...). I think as of now, I'd prefer that we close this PR, but I am open to being convinced otherwise. I don't think there's an approach to this that avoids paying the cost for the extra work getting expanded into a bunch of user code (even if the runtime cost is ~0). |
...instead of having a panic case.
Continues #89139
r? @Mark-Simulacrum