From 0744fdd1d26c35c64b8b81bbaf63aeeb32abbf81 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Thu, 23 Jul 2020 13:03:00 +0200 Subject: [PATCH] :wrench: Improve benchmark --- scripts/benchmark.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/benchmark.sh b/scripts/benchmark.sh index 17b0a24b..f4f7884b 100644 --- a/scripts/benchmark.sh +++ b/scripts/benchmark.sh @@ -3,6 +3,7 @@ language=("gwion" "wren" "lua" "python" "chuck" "ruby") extension=("gw" "wren" "lua" "py" "ck" "rb") test_dir="benchmark" +result_dir="$test_dir/results" plot_script="scripts/bench.plot" : "${repeats:=10}" @@ -18,22 +19,19 @@ get_list() { } get_test() { - for (( i=0; i<=$(( ${#language[@]} -1 )); i++ )) + for i in $(seq 0 ${#language[@]}) do if [ -f "$test_dir/$1.${extension[$i]}" ] then echo "${language[$i]} $(run "${language[$i]}" "${extension[$i]}" "$1")" fi - done > "benchmark/results/$1.dat" + done > "$result_dir/$1.dat" } plot() { - which perf - echo "$1" - cat "benchmark/results/$1.dat" gnuplot -e "bench='$1'" "$plot_script" } -[ -d benchmark/results ] || mkdir benchmark/results +[ -d "$result_dir/results" ] || mkdir "$result_dir" for bench in $(get_list) do get_test "$bench" -- 2.43.0