-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Improve release compile time #5113
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
I don't think we want |
And I think, the only time Clippy gets compiled in release mode is when shipping it. |
Or am I missing something? |
No, it still be compile with optimization. Only build scripts (
It's a fair point. But I think a case when someone build clippy from source. |
# With this change
cargo build --release 451.07s user 7.01s system 239% cpu 3:11.53 total
# Without this change
cargo build --release 515.73s user 5.77s system 253% cpu 3:25.63 total Which is only ~7% faster. I don't think that this matters for people that want to compile Clippy from source. |
You're right. I just measure it now. In my machine, it doesn't make a noticeable different in compilation time. Remove it then.
At least it is an improvement. If you think this is a risky or unknown trade-off, I would close this PR. |
I really don't know, how big the difference is. We could try to run it on some crates and time it with and without this change. |
7693a46
to
2a81542
Compare
To move the discussion a bit forward: Would it help if we had a performance dashboard where we run Clippy on a few crates or code examples? Maybe integration in perf.rust-lang.org is something that's possible? |
I think that would help to optimize Clippy. |
☔ The latest upstream changes (presumably #5314) made this pull request unmergeable. Please resolve the merge conflicts. |
Do we know if change like this PR won't make Clippy run slower on large code bases? |
This PR is about compilation time. IMO it shouldn't affect runtime performance. |
Yeah not convinced that this is very useful to have, and given that it's making clippy_dev worse perhaps we should leave things as is and close this? In general it is worth playing around with build_override though, thanks for investigating! |
Ok fine |
On my test, it reduced release compile time of root project from 62.9s to 54.2s.
cargo-timing files: https://send.firefox.com/download/42c022429ebe714d/#g0unPjM989ED38syPZU3Fg
changelog: none