diff --git a/scripts/criterion/aquatic-http-announce-response-to-bytes.sh b/scripts/criterion/aquatic-http-announce-response-to-bytes.sh index 9d9b8ca..a5ed350 100755 --- a/scripts/criterion/aquatic-http-announce-response-to-bytes.sh +++ b/scripts/criterion/aquatic-http-announce-response-to-bytes.sh @@ -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_announce_response_to_bytes -- --noplot --baseline latest \ No newline at end of file +cargo bench --bench bench_announce_response_to_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/announce-response-to-bytes/ && + rm -r latest && + mv new latest && + echo "Replaced previous benchmark" + ;; +esac \ No newline at end of file