-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustbuild is 1.4 times slower than make at building and testing #38284
Comments
There's also huge regression in building/testing time caused by not running stage2 tests and build for stage2-stuff-required-only-for-plugins in parallel. In addition, the build system itself ( |
This certainly comes as a surprise to me, fundamentally there's virtually no difference between rustbuild and the makefiles in how crates are compiled or sequenced. Could you gist full logs of the rustbuild build (which has timings) and help gather timing data related to the makefile build as well? That'd help diagnose this issue and see what's going on. It's true that tests aren't run as parallel as they were before, although I wouldn't expect that to cause such a large difference in time. I don't believe compiling |
I'll try to do some more detailed measurements during the week, but my first impression was that something was under-parallelized, either due to bad dependency graph or some other reasons. |
This means something not related to parallelism is in play as well.
|
Is there a way to tell cargo to report build times for each crate? |
According to + total build times reported by rustbuild, not especially informative:
Sum of the above times: 854.5 seconds, total time 872.5 seconds (i.e. 18 seconds spent on running pfail tests, syncronizing submodules and doing other infra). |
Thanks for the info! Most of those extra crates should be quite small and not take any time at all to compile (except I wonder, how long does the submodule management take locally? That's something I've seen take quite awhile and the makefiles only do it on Unfortunately I don't know of a way to get Cargo to print out per-crate timings, or at least not a built-in method. A change to |
3-4 seconds maybe, not something to worry about.
Yeah, I'll modify rustc, or rustbuild, or whatever necessary to get these timings tomorrow. That extra minute should hide somewhere after all. |
Here are raw times in seconds for make:
rustbuild:
|
Analysis! Time spent in
Good news: rustbuild doesn't affect time spent in Time spent outside of
Good news: build infrastructure itself (Cargo + rustbuild) doesn't eat noticeable amount of time compared to Total times: |
Thanks for the detailed analysis @petrochenkov! Definitely quite helpful. From these numbers it looks like there's two lion's share items we can tackle:
Jemalloc is definitely the easier of the two here. We unconditionally run Rustdoc is a bit harder, unfortunately. The major thing here is we need to avoid compiling librustdoc. We could toy around with moving librustdoc to I think that should cover almost everything, right? Or were there other pieces that were taking quite awhile? |
Yes, this should fix most of performance problems for stage 1 and |
Build everything (without LLVM):
make -j8
../x.py build -j8
Build stage 1 and test something (without LLVM):
make check-stage1-rpass -j8
../x.py test --stage 1 src/test/run-pass -j8
Default build config + enabled ninja were used in both cases.
cc @alexcrichton
The text was updated successfully, but these errors were encountered: