Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile time regression with the new trait solver and diesel #131231

Open
weiznich opened this issue Oct 4, 2024 · 5 comments
Open

Compile time regression with the new trait solver and diesel #131231

weiznich opened this issue Oct 4, 2024 · 5 comments
Labels
C-bug Category: This is a bug. I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Comments

@weiznich
Copy link
Contributor

weiznich commented Oct 4, 2024

I tried this code: diesel-rs/diesel@381be19 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

@weiznich weiznich added the C-bug Category: This is a bug. label Oct 4, 2024
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. I-compiletime Issue: Problems and improvements with respect to compile times. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Oct 4, 2024
@jieyouxu jieyouxu added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 4, 2024
@saethlin saethlin added T-types Relevant to the types team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 4, 2024
@lcnr
Copy link
Contributor

lcnr commented Oct 8, 2024

does #130821 impact the compile times here, currently travelling to EuroRust and can't get to compile diesel on the dev desktops

@weiznich
Copy link
Contributor Author

weiznich commented Oct 8, 2024

I've tried it again with today's nightly and I fear the results are at least not better.

Version:

rustc 1.83.0-nightly (3ae715c8c 2024-10-07)
binary: rustc
commit-hash: 3ae715c8c63f9aeac47cbf7d8d9dadb3fa32c638
commit-date: 2024-10-07
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.1

Times:
Old Solver: 19s
New Solver: 3:47min

(Differences in the old solver times are likely due to running on battery right now, due to traveling to Vienna as well)

@weiznich
Copy link
Contributor Author

I checked this again today with the following nightly version:

rustc 1.84.0-nightly (143ce0920 2024-11-10)
binary: rustc
commit-hash: 143ce0920a2307b19831160a01f06f107610f1b2
commit-date: 2024-11-10
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.3

Times for cargo check -p diesel:
Old Solver: 20s
New Solver: 3:33min

cc @compiler-errors @lcnr

@lqd
Copy link
Member

lqd commented Nov 11, 2024

Is performance testing the new solver expected or useful now compared to when it's more complete (and the work to improve its performance actually starts)?

@lcnr
Copy link
Contributor

lcnr commented Nov 11, 2024

I think knowing about the regression in diesel is useful, even if it isn't a priority right now. It will definitely be useful once bootstrap is working and we're looking into our benchmarks in more detail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

No branches or pull requests

6 participants