-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrunhashbenchmark.sh
executable file
·96 lines (86 loc) · 4.5 KB
/
runhashbenchmark.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
if [[ -z "$1" ]]; then
maxkeycount=80000000
echo Initializing data
mkdir -p /tmp/hashmarkcache
if [[ ! -f /tmp/hashmarkcache/dics ]]; then
if [[ -d /usr/share/hunspell/ ]]; then dicpath=/usr/share/hunspell/;
elif [[ -d /usr/share/myspell/ ]]; then dicpath=/usr/share/myspell/;
else echo no dics; exit;
fi
dics="$dicpath/de_DE.dic:$dicpath/en_US.dic"
./hashbenchmark --sources=$dics --maxkeycount=$maxkeycount --failqueriesperkey=0 --mode=dumpdata --dumpdata=/tmp/hashmarkcache/dics
fi
if [[ ! -f /tmp/hashmarkcache/200 ]]; then
./hashbenchmark --keylen=200 --maxkeycount=$maxkeycount --keycount=100000 --failqueriesperkey=0 --mode=dumpdata --dumpdata=/tmp/hashmarkcache/200
fi
if [[ ! -f /tmp/hashmarkcache/8 ]]; then
./hashbenchmark --keylen=8 --maxkeycount=$maxkeycount --keycount=100000 --failqueriesperkey=0 --mode=dumpdata --dumpdata=/tmp/hashmarkcache/8
fi
if swapon -s | grep . > /dev/null; then echo WARNING: swap memory detected. Disable it with swapoff -a, or the benchmarks will be very slow and the results useless; fi
echo Benchmarking...
mkdir -p results
./hashbenchmark --mode=list | while read map; do
echo Benchmarking map $map
./runhashbenchmark.sh "$map"
done
exit;
fi;
name=$1
args="--filter=$name --mode=multi-run --memlimit=8192 --timelimit=300000"
function run(){
cache="--cacheddata /tmp/hashmarkcache/$1"
queriesperkey=$2
failqueriesperkey=$3
result=results/$name.$1.$2.$3
if [[ ! -f $result ]]; then
keycount=1000;
basekeycount=1000;
else
keycount=$(tail -n 1 $result | tail -1 | cut -f 2 -d' ')
basekeycount=$(sed -e 's/[^0]/1/' <<<$keycount)
fi
echo Test set $result
./hashbenchmark $args $cache --keycount=$keycount --basekeycount=$basekeycount --queriesperkey $queriesperkey --failqueriesperkey $failqueriesperkey >> $result
echo
}
run dics 0 0
run dics 3 3
run dics 20 2
run dics 2 20
run 200 0 0
run 200 3 3
run 200 20 2
run 200 2 20
run 8 0 0
run 8 3 3
run 8 20 2
run 8 2 20
exit
#./hashbenchmark --sources=$dics --filter=$1 --mode=multi-run --keycount=1000 --memlimit=4096 --timelimit=180000 --queriesperkey 0 --failqueriesperkey 0 > results/$1.dics.0.0
#./hashbenchmark --sources=$dics --filter=$1 --mode=multi-run --keycount=1000 --memlimit=4096 --timelimit=180000 --queriesperkey 3 --failqueriesperkey 3 > results/$1.dics.3.3
#./hashbenchmark --sources=$dics --filter=$1 --mode=multi-run --keycount=1000 --memlimit=4096 --timelimit=180000 --queriesperkey 20 --failqueriesperkey 2 > results/$1.dics.20.2
#./hashbenchmark --sources=$dics --filter=$1 --mode=multi-run --keycount=1000 --memlimit=4096 --timelimit=180000 --queriesperkey 2 --failqueriesperkey 20 > results/$1.dics.2.20
#
#./hashbenchmark --keylen=8 --filter=$1 --mode=multi-run --keycount=1000 --memlimit=4096 --timelimit=180000 --queriesperkey 0 --failqueriesperkey 0 > results/$1.8.0.0
#./hashbenchmark --keylen=8 --filter=$1 --mode=multi-run --keycount=1000 --memlimit=4096 --timelimit=180000 --queriesperkey 3 --failqueriesperkey 3 > results/$1.8.3.3
#./hashbenchmark --keylen=8 --filter=$1 --mode=multi-run --keycount=1000 --memlimit=4096 --timelimit=180000 --queriesperkey 20 --failqueriesperkey 2 > results/$1.8.20.2
#./hashbenchmark --keylen=8 --filter=$1 --mode=multi-run --keycount=1000 --memlimit=4096 --timelimit=180000 --queriesperkey 2 --failqueriesperkey 20 > results/$1.8.2.20
#
#./hashbenchmark --keylen=200 --filter=$1 --mode=multi-run --keycount=1000 --memlimit=4096 --timelimit=180000 --queriesperkey 0 --failqueriesperkey 0 > results/$1.200.0.0
#./hashbenchmark --keylen=200 --filter=$1 --mode=multi-run --keycount=1000 --memlimit=4096 --timelimit=180000 --queriesperkey 3 --failqueriesperkey 3 > results/$1.200.3.3
#./hashbenchmark --keylen=200 --filter=$1 --mode=multi-run --keycount=1000 --memlimit=4096 --timelimit=180000 --queriesperkey 20 --failqueriesperkey 2 > results/$1.200.20.2
#./hashbenchmark --keylen=200 --filter=$1 --mode=multi-run --keycount=1000 --memlimit=4096 --timelimit=180000 --queriesperkey 2 --failqueriesperkey 20 > results/$1.200.2.20
#echo "::" $1 $options
#failslist="0 1 100"
#readslist="0 1 20 100"
#lenlist="4 32 200"
#for fails in $failslist; do
# for reads in $readslist; do
# ./hashbenchmark --sources=$dics --filter=$1 --mode=multi-run --keycount=1000 --memlimit=4096 --timelimit=180000 > results/$1.$reads.$fails.dics
# for len in $lenlist; do
# ./hashbenchmark --filter=$1 --mode=multi-run --keycount=1000 --keylen=4 --memlimit=4096 --timelimit=180000 > results/$1.$reads.$fails.$len
# done
# done
#done;
#