Open Kixiron opened 4 years ago
@Kixiron could you run -Z self-profile
on the crate and see if anything sticks out as taking much longer than the rest? https://github.com/rust-lang/measureme/blob/master/summarize/Readme.md
Wow, that's almost completely LLVM.
Have you tried turning off LTO, or using ThinLTO instead?
No matter the LTO settings it's still a long time, it is less though
@Kixiron in debug mode, -C no-prepopulate-passes
brought this down from 31 to 24 seconds for me. It doesn't work for release mode though (or at least, the fix is worse than the cure: the flag means 'do absolutely no optimizations not even the easy ones').
Your main issue is that the compiler is just doing a staggering amount of work; -Z print-mono-items
shows me over 100000 items being defined and compiled, even more than rustc_middle (https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Making.20rustc_middle.20faster.20to.20compile/near/212154272).
differential-datalog
makes heavy use oftimely-dataflow
anddifferential-dataflow
. When using this library, compile times are excessively slow (even when no changes are made to the library itself), taking up to 10 minutes to build in debug mode and much longer in release mode.Running
llvm-lines
reveals a lot of code being generated, withptr::drop_in_place()
leading the bunchFull output
Running
cargo-bloat
shows that the crate takes up almost 17mb in debug mode and a still sizeable 2mb in release modeDebug mode
Release mode
Meta
rustc --version --verbose
:Both windows and linux were tested