Skip to content

Instantly share code, notes, and snippets.

@Mark-Simulacrum
Created May 15, 2019 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mark-Simulacrum/b5dd679b03ad3b979ffad2dfea2a7efc to your computer and use it in GitHub Desktop.
Save Mark-Simulacrum/b5dd679b03ad3b979ffad2dfea2a7efc to your computer and use it in GitHub Desktop.
#!/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