I understand that the conventional wisdom is that Rust compilation times from scratch are in the same ballpark as those of C++. (example of wisdom). But has anybody done any benchmarking to give this claim more evidence (and I have no idea how one should compare compilation times of different languages) ?
Quick measurements on the recent benchmark “show” that
rustc is about twice as slow as clang/gcc
% git clone https://github.com/ncm/nytm-spelling-bee.git % cd nytm-spelling-bee/ % time make puzzlegen-cc g++ -g3 -O3 -std=c++14 -Wall -march=corei7 puzzlegen.cc -o puzzlegen-cc make puzzlegen-cc 1.22s user 0.09s system 91% cpu 1.435 total % time make puzzlegen-rs rustc -C debuginfo=2 -C opt-level=3 -C target-cpu=corei7 puzzlegen.rs -o puzzlegen-rs make puzzlegen-rs 2.59s user 0.06s system 99% cpu 2.673 total % sed -i 's/g++/clang++/g' Makefile % make clean rm -f puzzlegen-cc.o puzzlegen-rs.a puzzlegen-cc puzzlegen-rs cc.bench rs.bench all.bench *.bench.out % time make puzzlegen-cc clang++ -g3 -O3 -std=c++14 -Wall -march=corei7 puzzlegen.cc -o puzzlegen-cc make puzzlegen-cc 1.32s user 0.04s system 94% cpu 1.445 total