5 echo "$0 <file.{xml, srx}>"
9 if [ -z "$1" -o ! -f "$1" ]
17 FILENAME=`basename "$DOC"`
18 FILENAME=`echo "$FILENAME" | sed -e 's/\.srx/\.xml/'`
19 REFERENCE=tests/perf_tests/"$FILENAME".best
20 QUERIES=tests/perf_tests/"$FILENAME".queries
41 echo -n -e "${START}${2}${END}"
47 cat "$FILE" | tail -n +"$I" | head -n 1
58 REF=`getline "$REFERENCE" "$I"`
59 RCOUNT=`echo "$REF" | cut -f 2 -d ,`
60 RTCOUNT=`echo "$REF" | cut -f 3 -d ,`
61 RTMAT=`echo "$REF" | cut -f 4 -d ,`
63 ./main.native -r 1 -d -c "$DOC" "$Q" > tmp 2>&1
64 TCOUNT=`cat tmp | grep 'Execution time' | grep -o '[0-9]\+\.[0-9]*' | sort -g | head -1`
65 CCOUNT=`cat tmp | grep 'Number of results' | grep -o '[0-9]\+'`
67 ./main.native -r 1 -d "$DOC" "$Q" > tmp 2>&1
68 TMAT=`cat tmp | grep 'Execution time' | grep -o '[0-9]\+\.[0-9]*' | sort -g | head -1`
69 MCOUNT=`cat tmp | grep 'Number of results' | grep -o '[0-9]\+'`
74 if [ "$MCOUNT" != "$CCOUNT" ]
76 echo "Count mismatch between counting and materialization ! ($MCOUNT, $CCOUNT)"
81 if [ "$MCOUNT" != "$RCOUNT" -a "$RCOUNT" ]
83 echo "Count mismatch between current and reference implementation!"
88 CSPEED=`echo '5k 1 ' "$TCOUNT" "$RTCOUNT" ' / - p' | dc`
89 echo -n "Reference counting time: $RTCOUNT, Current counting time: $TCOUNT, "
92 cecho yellow "slow-down: $CSPEED"
94 -*) cecho red "slow-down: $CSPEED"
97 cecho green "speed-up: $CSPEED"
102 MSPEED=`echo '5k 1 ' "$TMAT" "$RTMAT" ' / - p' | dc`
103 echo -n "Reference mat. time: $RTMAT, Current mat. time: $TMAT, "
106 cecho yellow "slow-down: $MSPEED"
108 -*) cecho red "slow-down: $MSPEED"
111 cecho green "speed-up: $MSPEED"