Compile time regression with the new trait solver and diesel
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried this code: https://github.com/diesel-rs/diesel/commit/381be195688db339fe2927e49bc818ab86754dd9 with both RUSTFLAGS=-Znext-solver=globally set and not set
I expected to see this happen: Code compiles similar fast with both combinations
Instead, this happened: RUSTFLAGS=-Znext-solver=globally results in the code compiling takes over 10 times as long. For me the compiler takes ~10s to compile diesel from scratch with the old trait solver. The same operation takes 1:53 min, so over 10 times of what the old trait solver needed.
Meta
rustc --version --verbose:
rustc 1.83.0-nightly (9ff5fc4ff 2024-10-03)
binary: rustc
commit-hash: 9ff5fc4ffbbe1e911527aa054e789b05ae55ffcc
commit-date: 2024-10-03
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.0
@rustbot label +I-compiletime +WG-trait-system-refactor
Contributor guide
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
Reproduce the Diesel commit 381be195688db339fe2927e49bc818ab86754dd9 with rustc 1.83.0-nightly (9ff5fc4ff) using and omitting RUSTFLAGS=-Znext-solver=globally. Compare clean-build times and investigate the trait-system compiler path; done means the large compile-time regression is explained and the two configurations compile at comparable speed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100