-
Notifications
You must be signed in to change notification settings - Fork 0
/
bench.sh
executable file
·56 lines (51 loc) · 1.18 KB
/
bench.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
#!/bin/sh
dirlist=$(ls new-nofib-ocaml-gen)
# special test durations for some tests that last longer
Cryptarithm_nofib_lh=1200
Fish_nofib_lh=30
LastPiece_nofib_lh=30
Mate_nofib_lh=90
Secretary_nofib_lh=400
echo compile and running the tests ...
# compile and run the tests
for dir in $dirlist
do
(
cd new-nofib-ocaml-gen/$dir
echo ""
echo vvvv $dir vvvv
cmd=$(head -2 ./main.ml | tail -1)
if [ "$dir" = "Cryptarithm_nofib_lh" ]
then
c=$cmd" -q"" $Cryptarithm_nofib_lh"
elif [ "$dir" = "Fish_nofib_lh" ]
then
c=$cmd" -q"" $Fish_nofib_lh"
elif [ "$dir" = "LastPiece_nofib_lh" ]
then
c=$cmd" -q"" $LastPiece_nofib_lh"
elif [ "$dir" = "Mate_nofib_lh" ]
then
c=$cmd" -q"" $Mate_nofib_lh"
elif [ "$dir" = "Secretary_nofib_lh" ]
then
c=$cmd" -q"" $Secretary_nofib_lh"
else
c=$cmd" -q"" 20"
fi
eval $c
)
done | tee ./plot/time.txt
echo done
echo collecting binary size information ...
# after the compilation, print the size information
for dir in $dirlist
do
(
cd new-nofib-ocaml-gen/$dir
echo ""
echo vvvv $dir vvvv
ls -l Module*.o | awk -vdir=$dir '{gsub(/_nofib/, "", dir); print dir", "$9", "$5}'
)
done | tee ./plot/size.txt
echo done