rust/compiler/rustc_monomorphize/src
Matthias Krüger c3cd05198a
Rollup merge of #113872 - nnethercote:tweak-cgu-sorting, r=pnkfelix
Tweak CGU sorting in a couple of places.

In `base.rs`, tweak how the CGU size interleaving works. Since #113777, it's much more common to have multiple CGUs with identical sizes. With the existing code these same-sized items ended up in the opposite-to-desired order due to the stable sorting. The code now starts with a reverse sort (like is done in `partitioning.rs`) which gives the behaviour we want. This doesn't matter much for perf, but makes profiles in `samply` look more like what we expect.

In `partitioning.rs`, we can use `sort_by_key` instead of `sort_by_cached_key` because `CGU::size_estimate()` is cheap. (There is an identical CGU sort earlier in that function that already uses `sort_by_key`.)

r? `@pnkfelix`
2023-07-27 06:04:12 +02:00
..
collector.rs refactor(rustc_middle): Substs -> GenericArg 2023-07-14 13:27:35 +01:00
errors.rs
lib.rs get rid of a bit more calls to poly_select 2023-07-06 16:50:12 +00:00
partitioning.rs Rollup merge of #113872 - nnethercote:tweak-cgu-sorting, r=pnkfelix 2023-07-27 06:04:12 +02:00
polymorphize.rs refactor(rustc_middle): Substs -> GenericArg 2023-07-14 13:27:35 +01:00
util.rs refactor(rustc_middle): Substs -> GenericArg 2023-07-14 13:27:35 +01:00