criterion request-from-bytes script: ask user about saving result

This commit is contained in:
Joakim Frostegård 2020-07-21 15:59:32 +02:00
parent b3154c5bcf
commit c1b2a30803

View file

@ -1,7 +1,19 @@
#!/bin/sh
# Compare against latest. If you commit changes, replace "latest" directory
# with "new" directory after running benchmark.
#!/bin/bash
# Run benchmark, comparing against previous result.
set -e
export RUSTFLAGS="-C target-cpu=native"
cargo bench --bench bench_request_from_bytes -- --noplot --baseline latest
cargo bench --bench bench_request_from_bytes -- --noplot --baseline latest
read -p "Replace previous benchmark result with this one (y/N)? " answer
case ${answer:0:1} in
y|Y )
cd aquatic_http_protocol/target/criterion/request-from-bytes/ &&
rm -r latest &&
mv new latest &&
echo "Replaced previous benchmark"
;;
esac