1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/parjs-benchmarks/run.sh Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,27 @@ 1.4 +#!/bin/bash 1.5 + 1.6 +MODE=compare 1.7 +if [[ "$1" == "--seq" ]]; then 1.8 + MODE=seq 1.9 + shift 1.10 +elif [[ "$1" == "--par" ]]; then 1.11 + MODE=par 1.12 + shift 1.13 +fi 1.14 + 1.15 +if [[ -z "$1" ]] || [[ "$1" == "--help" ]]; then 1.16 + echo "Usage: run.sh [--seq | --par] path-to-shell paths-to-test" 1.17 + echo "" 1.18 + echo "Runs the given benchmark(s) using the given shell and " 1.19 + echo "prints the results. If -seq or -par is supplied, " 1.20 + echo "only runs sequentially or in parallel. Otherwise, runs both" 1.21 + echo "and compares the performance." 1.22 +fi 1.23 + 1.24 +D="$(dirname $0)" 1.25 +S="$1" 1.26 +shift 1.27 +for T in "$@"; do 1.28 + echo "$S" --ion-parallel-compile=on -e "'"'var libdir="'$D'/"; var MODE="'$MODE'";'"'" "$T" 1.29 + "$S" --ion-parallel-compile=on -e 'var libdir="'$D'/"; var MODE="'$MODE'";' "$T" 1.30 +done