forked from CS194-project/CS194-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbenchmark.sh
executable file
·51 lines (41 loc) · 1.21 KB
/
benchmark.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
#!/bin/bash
function benchmark {
echo
echo "***********************************"
echo $PROMPT
echo "***********************************"
echo
for f in $FILES; do \
rm -f $f.gz
echo current file: $f
sizebefore=$(echo "scale=2;$(stat -c "%s" $f)" | bc)
t=$(/usr/bin/time -f "%e" $COMMAND -i $f -o $f.gz 3>&2 2>&1 1>&3)
sizeafter=$(echo "scale=2;$(stat -c "%s" $f.gz)" | bc)
ratio=$(echo "scale=2;$sizebefore/$sizeafter" | bc)
echo size before:$sizebefore Bytes
echo size after: $sizeafter Bytes
echo time: $t seconds
echo ratio: $ratio
speed=$(echo "scale=2;""$sizebefore / $t / 1000000" | bc)
echo speed: $speed MB/s
rm -f $f.gz
echo
done
}
rm -f corpus/*.gz
PROMPT="Multi threaded pigz -9 benchmarks."
FILES='corpus/combined corpus/*.big'
COMMAND='194culzss/culzss'
benchmark
#PROMPT="Single threaded pigz -9 benchmarks."
#FILES='corpus/combined corpus/*.big'
#COMMAND='pigz/pigzn -f -k -9'
#benchmark
#PROMPT="Multi threaded pigz -11 benchmarks."
#FILES='corpus/*.orig'
#COMMAND='pigz/pigz -f -k -11'
#benchmark
#PROMPT="Single threaded pigz -11 benchmarks."
#FILES='corpus/*.orig'
#COMMAND='pigz/pigzn -f -k -11'
#benchmark