-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbenchmark.sh
executable file
·62 lines (49 loc) · 1.07 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
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# verbose output
set -x
source ../common/set-cpus.sh
IMAGES=images/
function cleanup {
# kill all children (evil)
killall -9 qemu-system-x86
pkill -9 qemu-system-x86
pkill -P $$
}
trap "cleanup" EXIT
mkdir -p results
for alloc in "buddy" "tinyalloc" "mimalloc" "tlsf"
do
LOG=results/${alloc}.csv
echo "num_queries speedup" > $LOG
for queries in 10 100 1000 10000 60000 100000
do
for j in {1..20}
do
{
if (( $queries > 10000 )); then
sleep 8
else
sleep 2
fi
killall -9 qemu-system-x86
} &
script .out -c "taskset -c ${CPU1} qemu-guest \
-i sqlitebenchmark.cpio \
-k ${IMAGES}/${queries}/unikraft+${alloc}.kernel \
-a '' -m 1024 -p ${CPU2}"
wait
if ! grep -q "I/O error" .out; then
res=`cat .out | \
awk -e '$0 ~ /queries in/ {print $4}' | \
sed -e "s/\r//g"`
echo "${queries} ${res}" | tee -a $LOG
fi
# stop server
killall -9 qemu-system-x86
pkill -9 qemu-system-x86
rm .out
done
done
done
# for some reason these experiments mess up the terminal
reset