rust-lang / rust-lang/rustc_codegen_cranelift
Improve results on the rustc-perf benchmark suite
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 157
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 3
Description
I only ran the debug benchmarks, as check should be identical and release will definitively be faster because of much less optimizations by cg_clif.
Except for some stress-tests the clean and baseline incremental results are quite positive (~10-60% improvement, often ~40%) For clean incremental the results are much worse (easily ~200%), as compiled object files are not stored in the incremental cache (#760) For patched incremental the results are very mixed. Sometimes the difference is just a little bit less than clean incremental, while in other cases it is up to ~70% faster than cg_llvm.
packed-simd failed due to a verifier error. Edit(2020-03-11): Opened #919. hyper-2 failed due to unsized locals not being implemented (used for impl FnOnce for Box<FnOnce>). Edit(2020-03-11): Fixed in #916. style-servo failed due to running out of disk space.
Patch for rustc-perf
diff --git a/collector/src/bin/rustc-perf-collector/execute.rs b/collector/src/bin/rustc-perf-collector/execute.rs
index 9aa2cc48..4f577183 100644
--- a/collector/src/bin/rustc-perf-collector/execute.rs
+++ b/collector/src/bin/rustc-perf-collector/execute.rs
@@ -203,13 +203,19 @@ impl<'a> CargoProcess<'a> {
fn run_rustc(&mut self) -> anyhow::Result<()> {
loop {
let mut cmd = self.base_command(self.cwd, "rustc");
+ cmd.env("RUSTFLAGS", "-Cpanic=abort \
+ -Zcodegen-backend=~/Documents/cg_clif/target/release/librustc_codegen_cranelift.so \
+ --sysroot ~/Documents/cg_clif/build_sysroot/sysroot");
+ cmd.arg("--target").arg("x86_64-unknown-linux-gnu");
cmd.arg("-p").arg(self.get_pkgid(self.cwd));
match self.build_kind {
BuildKind::Check => {
+ return Ok(());
cmd.arg("--profile").arg("check");
}
BuildKind::Debug => {}
BuildKind::Opt => {
+ return Ok(());
cmd.arg("--release");
}
}
Results

Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the rustc-perf benchmark results and collector/src/bin/rustc-perf-collector/execute.rs, then reproduce the reported debug, clean incremental, baseline incremental, and patched incremental cases. Review the failures referenced for packed-simd, hyper-2, and style-servo, along with #760, #916, and #919. Done should mean a clearly defined benchmark improvement with reproducible results and resolved or documented failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100