From 8fac59de425c0a90c7377e0a690e188e334f39db Mon Sep 17 00:00:00 2001 From: Gunnar Morling Date: Wed, 10 Jan 2024 11:41:21 +0100 Subject: [PATCH] #281 Trimming slowest/fastest run, not first/last in evaluate2.sh --- evaluate2.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evaluate2.sh b/evaluate2.sh index ab54d7a..30097ca 100755 --- a/evaluate2.sh +++ b/evaluate2.sh @@ -170,7 +170,7 @@ for fork in "$@"; do # Trimmed mean = The slowest and the fastest runs are discarded, the # mean value of the remaining three runs is the result for that contender - trimmed_mean=$(jq -r '.results[0].times | .[1:-1] | add / length' $fork-$filetimestamp-timing.json) + trimmed_mean=$(jq -r '.results[0].times | sort_by(.|tonumber) | .[1:-1] | add / length' $fork-$filetimestamp-timing.json) raw_times=$(jq -r '.results[0].times | join(",")' $fork-$filetimestamp-timing.json) if [ "$fork" == "$1" ]; then @@ -198,7 +198,7 @@ for fork in "$@"; do continue fi - trimmed_mean=$(jq -r '.results[0].times | .[1:-1] | add / length' $fork-$filetimestamp-timing.json) + trimmed_mean=$(jq -r '.results[0].times | sort_by(.|tonumber) | .[1:-1] | add / length' $fork-$filetimestamp-timing.json) # trimmed_mean is in seconds # Format trimmed_mean as MM::SS.mmm