On 10/14/2012 10:20 AM, John Mija wrote:
This email is related to one sent to the Go mailing list[1] about the
great difference in compiling time between Rust which took 50 minutes,
and Go with a time of 2 minutes in build compiler, all libraries, all
commands and testing.
That the entire test suite runs in under two minutes is an amazing feat.
Go's efficient toolchain is one of its great strengths.
We are probably never Going to catch Go here, but there is a whole lot
that Rust can do to improve.
Patrick discussed most of the major problems. There are general Rust
performance issues, specific compiler issues, and build system issues.
This email is about the build system.
There are _a lot_ of duplicate and redundant builds in a full build/test
run. I was curious about how long the build would take if we removed all
the redundancy. In other words, how long does it take an optimized rustc
to build and test all the Rust components, without optimizations, minus
LLVM and clang (which we presumably won't fork forever), just once?
(TL;DR 8m45s)
Here's the goal:
* Build these native components: libuv (C), rt (C++), rustllvm (C++)
* Build and test these crates: core, std, syntax, rustc, cargo, rustdoc,
compiletest
* Run the compiler test suite (everything in src/test) (including the
pretty-printer tests which run most of the test suite through entire
parser processes multiple times)
* Build and test the documentation
First I ran `make` to build the stage2 compiler, with optimizations on.
Then I ran `time make check CFG_DISABLE_OPTIMIZE=1
CFG_DISABLE_VALGRIND=1`. Due to the way crate testing is currently done
this will (re)do most of the work to build a full rust toolchain (yes,
testing the Rust compiler more or less involves a full rebuild). It will
build and test core, std, rustc, cargo, and rustdoc (not syntax which
has not a single unit test). It will also run the compiler test suite
and the documentation tests. Also builds 'compiletest', the compiler
test driver.
On my modest 4-core system that took 7m53s (and 15m53 cpu time, so some
parallelism).
Syntax, measured separately, took 18s. So around 8m10s to build and test
all the rust code. That leaves building libuv, rt, and rustllvm, and the
docs. I measure these as libuv/rt: 19s, rustllvm: 4s, docs: 12s. Total
of 35s for native code and docs.
That's 8m45s to compile and test all of Rust. To compare, simply running
`time make check`, using the default (optimized, valgrinding)
configuration, with a prebuilt llvm and clang, takes 36m. This machine
builds and tests go in under 2 minutes.
Getting the Rust build to actually go that fast in the default
configuration will take some work.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev