about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/check_alignment.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-05-26 11:52:25 +0000
committerbors <bors@rust-lang.org>2023-05-26 11:52:25 +0000
commit917b0b6c70f078cb08bbb0080c9379e4487353c3 (patch)
tree19a04ea9186a9aaed26b868eadc0e50250eb9d41 /compiler/rustc_mir_transform/src/check_alignment.rs
parent1221e43bdf413f7c405e9b17ef19d76c88222098 (diff)
parent9a86ceb049380a2a684b7bc8fd6c76235f51d9d1 (diff)
downloadrust-917b0b6c70f078cb08bbb0080c9379e4487353c3.tar.gz
rust-917b0b6c70f078cb08bbb0080c9379e4487353c3.zip
Auto merge of #111562 - clubby789:speedup-bootstrap-py, r=jyn514
Improve startup time of bootstrap

~~If the user has a `build/host` symlink set up, we can determine the target triple by reading it rather than invoking rustc. This significantly reduces startup time of bootstrap once any kind of build has been done~~
New approach explained below
```
➜  hyperfine -p 'git checkout -q master' -N './x.py -h' -r 50
Benchmark 1: ./x.py -h
  Time (mean ± σ):     140.7 ms ±   2.6 ms    [User: 99.9 ms, System: 39.3 ms]
  Range (min … max):   136.8 ms … 149.6 ms    50 runs

➜  rust git:(master) hyperfine -p 'git checkout -q speedup-bootstrap-py' -N './x.py -h' -r 50
Benchmark 1: ./x.py -h
  Time (mean ± σ):      95.2 ms ±   1.5 ms    [User: 67.7 ms, System: 26.7 ms]
  Range (min … max):    92.9 ms …  99.6 ms    50 runs
```

Also a small microoptimisation in using string splitting rather than regex when reading toml, which saves a few more milliseconds (2-5 testing locally), but less important.

Profiling shows the remaining runtime is around half setting up the Python runtime, and the vast majority of the remaining time is spent in subprocess building and running bootstrap itself, so probably can't be improved much further.
Diffstat (limited to 'compiler/rustc_mir_transform/src/check_alignment.rs')
0 files changed, 0 insertions, 0 deletions