Description
I noticed earlier that the compile time of image
increased massively during the beginning of 2015. Unfortunately it was hard to quantify this regression since we also changed a lot during this time.
Fortunately I just found a good example that shows a 20-fold increase in compile time. It is a single file with no other dependencies (if somebody wants to try: the original version is even much older). The two revisions are exactly the same code, the newer just has been updated to compile on a recent rustc. Note that this is rustc
only, no time is spend in llvm.
$ sudo rustc --version
rustc 0.13.0-nightly (7608dbad6 2014-12-31 10:06:21 -0800)
$ time sudo rustc --crate-type=lib -Z no-trans inflate.rs
real 0m1.176s
user 0m1.059s
sys 0m0.113s
(note that something is wrong with the old .pkg-file I used to install rustc, I need to use sudo to run it)
$ rustc --version
rustc 1.1.0-nightly (c4b23aec4 2015-04-29) (built 2015-04-28)
$ time rustc --crate-type=lib -Z no-trans inflate.rs
real 0m25.208s
user 0m23.919s
sys 0m1.213s
The time profiles show that driver::phase_1_parse_input
and driver::phase_2_configure_and_expand
almost stayed constant while the time spent in driver::phase_3_run_analysis_passes
exploded.