From c1b2a308031008ca0c3b0643eff5f659054be276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Tue, 21 Jul 2020 15:59:32 +0200 Subject: [PATCH] criterion request-from-bytes script: ask user about saving result --- .../aquatic-http-request-from-bytes.sh | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/scripts/criterion/aquatic-http-request-from-bytes.sh b/scripts/criterion/aquatic-http-request-from-bytes.sh index 32fdaa5..00d2589 100755 --- a/scripts/criterion/aquatic-http-request-from-bytes.sh +++ b/scripts/criterion/aquatic-http-request-from-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_request_from_bytes -- --noplot --baseline latest \ No newline at end of file +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 \ No newline at end of file