-
Notifications
You must be signed in to change notification settings - Fork 46
/
runbench.sh
66 lines (55 loc) · 1.28 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
59
60
61
62
63
64
65
66
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_gcc"\
"./cpp_clang"\
"./cpp_cached"\
"./c_fast"\
"./c_fast_arm"\
"./rkt"\
"mono -O=all ./cs.exe"\
"java jv"\
"scala LPath"\
"julia julia.jl"\
"dart dart.dart"\
"./hs"\
"./ml"\
"./lisp"\
"./rs"\
"./rs_unsafe"\
"./go"\
"./gccgo"\
"./d"\
"./nim"\
"./crystal"\
"luajit lj.lua"\
"/usr/bin/oraclejava ojv"\
"/usr/bin/node js.js"\
"/usr/bin/node jscache.js"\
"./f03"\
"./c"\
"hhvm php.php")
#"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