forked from logicchains/LPATHBench
/
runbench.sh
58 lines (47 loc) · 1.14 KB
/
runbench.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
if [ $# -ne 3 ]; then echo -e "Usage is sh $0 <correctresult> <raw output file> <html output file>"; exit 1; fi
echo "starting build" > isbuilding
echo "Compiling..."
make buildall
runners=( "mono fs.exe"\
"./cpp"\
"./rkt"\
"mono -O=all ./cs.exe"\
"java jv"\
"julia julia.jl"\
"dart dart.dart"\
"./hs"\
"./ml"\
"./lisp"\
"./rs"\
"./rs_unsafe"\
"./go"\
"./gccgo"\
"./d"\
"./nim"\
"./crystal"\
"luajit lj.lua"\
"/usr/bin/oraclejava ojv"\
"node js.js"\
"node jscache.js"\
"perl perl.pl")
echo "Running..."
start=""
${start} > rawRes
${start} > $3
for((i=0; i < ${#runners[@]}; i++));
do
# echo 'yolo'
${runners[i]} >> rawRes
done
filterStringPartOne='$2 == "LANGUAGE" && $1 == '
filterStringPartTwo=$1
filterStringPartThree=' { print $3 " " $4 }'
awkCmd=$filterStringPartOne$filterStringPartTwo$filterStringPartThree
echo $awkCmd > filterString.awk
awk -f filterString.awk ./rawRes > ./filteredRes
sort -k 2 -n ./filteredRes > ./sortedRes
cat sortedRes > $2
echo '| Language | Runtime (ms) |' >> $3
echo '| :------- | -----------: |' >> $3
echo '{print "| "$1" | "$2" |"}' > ./printtable.awk
awk -E printtable.awk ./sortedRes >> $3