Created
March 9, 2020 18:04
-
-
Save GoldsteinE/77eb631efdf67ad9ffc47b9c05538eaf 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 | |
cargo clean -p teloxide >/dev/null 2>&1 | |
echo "Iteration #$i:" | |
echo 'Debug:' | |
time cargo build >/dev/null 2>&1 | |
echo 'Release:' | |
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