Skip to content

Instantly share code, notes, and snippets.

@Emerentius
Created November 29, 2017 05:35
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 Emerentius/e15380b90c7723501fe9e4a08f8538b5 to your computer and use it in GitHub Desktop.
Save Emerentius/e15380b90c7723501fe9e4a08f8538b5 to your computer and use it in GitHub Desktop.
Test cargo incr comp
#!/usr/bin/env bash
cargo +nightly build --release 2> /dev/null
rm -rf ./target/
echo 'full build' > timings.txt
(time cargo +nightly build --release 2>/dev/null) 2>> timings.txt
export CARGO_INCREMENTAL=1
rm -rf ./target/
echo -e '\nfull incremental build' >> timings.txt
(time cargo +nightly build --release 2>/dev/null) 2>> timings.txt
touch ./src/lib.rs
echo -e '\ntouch lib.rs' >> timings.txt
(time cargo +nightly build --release 2>/dev/null) 2>> timings.txt
echo '#[allow(unused)] fn noop() {}' >> ./src/lib.rs
echo -e '\nadd noop' >> timings.txt
(time cargo +nightly build --release 2>/dev/null) 2>> timings.txt
# reset to earlier state
git checkout src/lib.rs
cat timings.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment