rust/src
Nicholas Nethercote 7c3ce02a11 Introduce a minimum CGU size in non-incremental builds.
Because tiny CGUs make compilation less efficient *and* result in worse
generated code.

We don't do this when the number of CGUs is explicitly given, because
there are times when the requested number is very important, as
described in some comments within the commit. So the commit also
introduces a `CodegenUnits` type that distinguishes between default
values and user-specified values.

This change has a roughly neutral effect on walltimes across the
rustc-perf benchmarks; there are some speedups and some slowdowns. But
it has significant wins for most other metrics on numerous benchmarks,
including instruction counts, cycles, binary size, and max-rss. It also
reduces parallelism, which is good for reducing jobserver competition
when multiple rustc processes are running at the same time. It's smaller
benchmarks that benefit the most; larger benchmarks already have CGUs
that are all larger than the minimum size.

Here are some example before/after CGU sizes for opt builds.

- html5ever
  - CGUs: 16, mean size: 1196.1, sizes: [3908, 2992, 1706, 1652, 1572,
    1136, 1045, 948, 946, 938, 579, 471, 443, 327, 286, 189]
  - CGUs: 4, mean size: 4396.0, sizes: [6706, 3908, 3490, 3480]

- libc
  - CGUs: 12, mean size: 35.3, sizes: [163, 93, 58, 53, 37, 8, 2 (x6)]
  - CGUs: 1, mean size: 424.0, sizes: [424]

- tt-muncher
  - CGUs: 5, mean size: 1819.4, sizes: [8508, 350, 198, 34, 7]
  - CGUs: 1, mean size: 9075.0, sizes: [9075]

Note that CGUs of size 100,000+ aren't unusual in larger programs.
2023-06-14 10:57:44 +10:00
..
bootstrap implement stdout streaming in render_tests::Renderer 2023-06-12 13:03:00 +03:00
ci Rollup merge of #112335 - loongarch-rs:gcc13, r=Mark-Simulacrum 2023-06-10 15:24:43 +02:00
doc Introduce a minimum CGU size in non-incremental builds. 2023-06-14 10:57:44 +10:00
etc Rollup merge of #111962 - theIDinside:better-gdb, r=Mark-Simulacrum 2023-06-06 12:00:32 +02:00
librustdoc Revert "List matching impls on type aliases" 2023-06-12 11:27:56 +02:00
llvm-project@22897bce7b Update to LLVM 16.0.5 2023-06-05 14:19:09 +02:00
rustdoc-json-types Verify that ItemEnum can be serialized and then deserialized using bincode 2023-05-22 18:26:20 +01:00
tools Add comment for arm_shim in generate-windows-sys 2023-06-12 22:40:30 +08:00
README.md Remove stale reference to the test suite location 2023-01-13 11:49:06 +00:00
stage0.json Bump to latest beta compiler 2023-05-30 08:00:10 -04:00
version Bump to 1.72.0 2023-05-27 14:23:37 -04:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.