Created
March 9, 2020 18:05
-
-
Save GoldsteinE/c38860dc43c6de3db8fa877223ea5e09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
preheat() { | |
echo "Pre-heating..." | |
cargo build >/dev/null 2>&1 | |
cargo build --release >/dev/null 2>&1 | |
} | |
run_benchmark() { | |
for i in $(seq 1 5); do | |
echo "Iteration #$i:" | |
echo 'Debug:' | |
cargo clean -p teloxide >/dev/null 2>&1 | |
time cargo build >/dev/null 2>&1 | |
echo 'Release:' | |
cargo clean -p teloxide >/dev/null 2>&1 | |
time cargo build --release >/dev/null 2>&1 | |
echo '' | |
done | |
} | |
set -e | |
git reset --hard | |
echo 'With #[derive(Hash)]:' | |
preheat | |
run_benchmark | |
echo '================================' | |
echo 'Without #[derive(Hash)]:' | |
for file in **/*.rs; do | |
sed -i 's/ Hash, / /g' "$file" | |
done | |
preheat | |
run_benchmark |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment