5 echo "$0 <file.{xml, srx}>"
9 if [ -z "$1" -o ! -f "$1" ]
23 FILENAME=`basename "$DOC"`
24 FILENAME=`echo "$FILENAME" | sed -e 's/\.srx/\.xml/'`
25 REFERENCE=tests/perf_tests/"$FILENAME".best
26 QUERIES=tests/perf_tests/"$FILENAME".queries
47 echo -n -e "${START}${2}${END}"
53 cat "$FILE" | tail -n +"$I" | head -n 1
69 REF=`getline "$REFERENCE" "$I"`
70 RCOUNT=`echo "$REF" | cut -f 2 -d ,`
71 RTCOUNT=`echo "$REF" | cut -f 3 -d ,`
72 RTMAT=`echo "$REF" | cut -f 4 -d ,`
74 ./main.native -c "$DOC" "$Q" > tmp 2>&1
75 TCOUNT=`cat tmp | grep 'Execution time' | grep -o '[0-9]\+\.[0-9]*' | sort -g | head -1`
76 CCOUNT=`cat tmp | grep 'Number of results' | grep -o '[0-9]\+'`
78 ./main.native "$DOC" "$Q" > tmp 2>&1
79 TMAT=`cat tmp | grep 'Execution time' | grep -o '[0-9]\+\.[0-9]*' | sort -g | head -1`
80 MCOUNT=`cat tmp | grep 'Number of results' | grep -o '[0-9]\+'`
85 if [ "$MCOUNT" != "$CCOUNT" ]
87 echo "Count mismatch between counting and materialization ! ($MCOUNT, $CCOUNT)"
92 if [ "$MCOUNT" != "$RCOUNT" -a "$RCOUNT" ]
94 echo "Count mismatch between current and reference implementation!"
99 CSPEED=`echo '5k 1 ' "$TCOUNT" "$RTCOUNT" ' / - p' | dc`
100 echo -n "Reference counting time: $RTCOUNT, Current counting time: $TCOUNT, "
103 cecho yellow "slow-down: $CSPEED"
105 -*) cecho red "slow-down: $CSPEED"
108 cecho green "speed-up: $CSPEED"
113 MSPEED=`echo '5k 1 ' "$TMAT" "$RTMAT" ' / - p' | dc`
114 echo -n "Reference mat. time: $RTMAT, Current mat. time: $TMAT, "
117 cecho yellow "slow-down: $MSPEED"
119 -*) cecho red "slow-down: $MSPEED"
122 cecho green "speed-up: $MSPEED"