-
Notifications
You must be signed in to change notification settings - Fork 13.8k
only call polymorphic array iter drop machinery when the type requires it #147353
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
base: master
Are you sure you want to change the base?
Conversation
3116ce6
to
7f10971
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
only call polymorphic array iter drop machinery when the type requires it
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (7a5c0c2): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.7%, secondary 2.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResults (primary -0.1%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 471.593s -> 470.766s (-0.18%) |
d418872
to
8e79e6d
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
only call polymorphic array iter drop machinery when the type requires it
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
8e79e6d
to
7f10971
Compare
First perf run looks better, going with that one. Binary sizes are down on average, including rustc artifact sizes. r? @scottmcm |
Is there any way we can have a test for the original problem? This feels like the kind of change that a well-meaning person could easily undo later without realizing it. |
On godbolt it only reproduces when linking a lib crate and then disassembling it. Using emit-asm doesn't work because it forces 1CGU. https://rust.godbolt.org/z/78fMrGGxc I could try writing a run-make test but seems a bit overkill. |
But I can add a comment. |
7f10971
to
ff91dbd
Compare
I saw a bunch of dead, empty
<[core::mem::maybe_uninit::MaybeUninit<T>; N] as core::array::iter::iter_inner::PartialDrop>::partial_drop
functions when compiling with more than 1 CGU.Let's see if we can help optimizations to eliminate stuff earlier.
r? ghost