Have arrays' drop_glue just unsize and call the slice version#155184
Have arrays' drop_glue just unsize and call the slice version#155184scottmcm wants to merge 1 commit intorust-lang:mainfrom
drop_glue just unsize and call the slice version#155184Conversation
|
|
|
|
||
| // RAW: ; core::ptr::drop_glue::<[array_drop_glue::NeedsDrop; [[N:7|13|42]]]> | ||
| // RAW-NEXT: inlinehint | ||
| // RAW: call core::ptr::drop_glue::<[array_drop_glue::NeedsDrop]> |
There was a problem hiding this comment.
Compare nightly https://rust.godbolt.org/z/5Wv1q86ja with a loop in each of the three.
This comment has been minimized.
This comment has been minimized.
|
💭 does it make sense to keep the array case separate for |
|
My understanding is that LLVM will very effectively inline those -- just like how we don't special case the array iterator for N ≤ 1 and still use the polymorphic version. Does make me ponder if we should have a separate general "hey, there's no |
d1bdee8 to
2ae092a
Compare
This comment has been minimized.
This comment has been minimized.
8a17db9 to
bf354cd
Compare
bf354cd to
1f28062
Compare
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
@bors try @rust-timer queue |
Oh, also for |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Have arrays' `drop_glue` just unsize and call the slice version
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (69592c2): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in 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 -1.3%, secondary -0.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.3%, secondary 1.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 499.861s -> 496.397s (-0.69%) |
It's silly to emit two loops (because of the drop ladder -- just one in panic=abort) for every array length that's dropped when we can just polymorphize to the slice version.
Built atop #154327 to avoid conflicts later, so draft for now.
r? @WaffleLapkin