Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
set -xe
# confirm that we can collect performance data
perf stat echo
git clone https://github.com/rust-lang-nursery/rustc-perf.git
cd rustc-perf
# build the collector
cargo build --release
# install toolchains (needs `cargo install rustup-toolchain-install-master`)
rustup-toolchain-install-master 80e7cde2238e837a9d6a240af9a3253f469bb2cf # single-thread compiler
rustup-toolchain-install-master 6f087ac1c17723a84fd45f445c9887dbff61f8c0 # parallel compiler
mv -i ~/.rustup/toolchains/80e7cde2238e837a9d6a240af9a3253f469bb2cf ./single-thread
mv -i ~/.rustup/toolchains/6f087ac1c17723a84fd45f445c9887dbff61f8c0 ./parallel
# setup output directory
mkdir -p data
touch data/.is-perf-timing-directory
mkdir -p data/times
export RUST_LOG=collector=info,collector::sysroot=debug
export SITE_URL="https://perf.rust-lang.org" # maybe not needed?
RUSTC_PATH=`pwd`/single-thread/bin/rustc
CARGO_PATH=`which cargo`
./target/release/collector --output-repo data bench_local \
--rustc $RUSTC_PATH --cargo $CARGO_PATH \
"single-thread";
RUSTC_PATH=`pwd`/parallel/bin/rustc
CARGO_PATH=`which cargo`
for rustc_j in 1 2 4 8 ; do # FIXME: go up to vCPU count (i.e., hyperthreads)
export RUSTC_THREAD_COUNT=$rustc_j
./target/release/collector --output-repo data bench_local \
--rustc $RUSTC_PATH --cargo $CARGO_PATH \
"parallel-rustc-$rustc_j";
done
# upload files from data/times and give Mark the link to put up on perf.rust-lang.org
# to view locally use ./target/release/site data and e.g.
# http://localhost:2346/compare.html?start=single-threaded&end=parallel-rustc-8&stat=wall-time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.