This avoids building cranelift twice in rust's CI and is a lot easier
than trying to make building of codegen backends work from within a
cargo invocation done by rust's build system.
This can be done by installing the nightly specified in
rust-toolchain.toml and then pointing the CARGO, RUSTC and RUSTDOC env
vars to the right executables.
I guess this was a leftover from very early in the development of
cg_clif. Allowing multiple threads significantly improves performance,
while panicking tests can run now thanks to -Zpanic-abort-tests.
This significantly improves performance. For example for the
simple-raytracer benchmark it goes from a 13% improvement over LLVM to
39% improvement over LLVM.
This is an additional 17% improvement on ./y.rs compile --sysroot none
Benchmark 1: ./y_before.bin build --sysroot none
Time (mean ± σ): 1.533 s ± 0.022 s [User: 1.411 s, System: 0.471 s]
Range (min … max): 1.517 s … 1.589 s 10 runs
Benchmark 2: ./y_after.bin build --sysroot none
Time (mean ± σ): 1.311 s ± 0.020 s [User: 1.232 s, System: 0.428 s]
Range (min … max): 1.298 s … 1.366 s 10 runs
Summary
'./y_after.bin build --sysroot none' ran
1.17 ± 0.02 times faster than './y_before.bin build --sysroot none'
By avoiding some redundant rustc calls and stripping debuginfo for
wrappers. ./y.rs build --sysroot none now runs 44% faster.
Benchmark 1: ./y_before.bin build --sysroot none
Time (mean ± σ): 2.200 s ± 0.038 s [User: 2.140 s, System: 0.653 s]
Range (min … max): 2.171 s … 2.303 s 10 runs
Benchmark 2: ./y_after.bin build --sysroot none
Time (mean ± σ): 1.528 s ± 0.020 s [User: 1.388 s, System: 0.490 s]
Range (min … max): 1.508 s … 1.580 s 10 runs
Summary
'./y_after.bin build --sysroot none' ran
1.44 ± 0.03 times faster than './y_before.bin build --sysroot none'