Commit 1946ef32 authored by David Baelde's avatar David Baelde

Merge branch 'master' of git.lsv.fr:schmitz/xpparser

parents 3dfe1f75 076ae494
......@@ -6,6 +6,21 @@ lib/
target/
tools/tex/totals_*.tex
tools/tex/matrix_*.tex
tools/tex/occurences_*.tex
tools/tex/*cov
tools/tex/*dat
tools/tex/MAXcount*
tools/tex/matrices
tools/tex/numqueries*
tools/tex/*tex
tools/extensions/*tex
tools/extensions/*dat
tools/extensions/*xml
tools/chord/chord.inner.svg
tools/chord/chord.pdf
tools/chord/chord.svg
tools/chord/numqueries
tools/chord/site/
*.swp
*.aux
*.log
......
......@@ -12,3 +12,22 @@ xqjson
guidomatic
teixsl
xquerydoc
adt
annotationstore
datascience
fots
functional
geospatial
graphviz
libs
linkmgmt
mlenrich
mlinvoker
openinfoman
oxfdict
rbtree
semanticweb
transform
treedown
xqtest
xqueryparser
......@@ -3,40 +3,91 @@
xslt=`grep 'xslt' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'`
xquery=`grep 'xquery' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'`
# XSLT queries (total)
total_xslt=0
for file in $xslt
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(/benchmark/xpath)" $file`
total_xslt=$(($total_xslt+$count))
done
# Xquery queries (total)
total_xquery=0
for file in $xquery
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(/benchmark/xpath)" $file`
total_xquery=$(($total_xquery+$count))
done
# Total queries
total=$(($total_xslt+$total_xquery))
printf '\\begin{tabular}{lrrr}\n'
printf '\\toprule\n'
printf 'Axis & XSLT & XQuery & Total \\\\\n'
printf '\\midrule\n'
axis_list=("ancestor" "attribute" "child" "descendant" "following" "following-sibling" "namespace" "parent" "descendant" "preceding" "preceding-sibling" "self")
axis_list=("ancestor" "attribute" "child" "descendant" "following" "following-sibling" "namespace" "parent" "preceding" "preceding-sibling" "self")
for axis in ${axis_list[*]}
do
printf '\\texttt{'
printf $axis
printf '}'
if [ $axis = "ancestor" ] || [ $axis = "descendant" ]; then
printf '(\\texttt{-or-self})'
fi
printf ' & '
# XSLT files
count_xslt=0
for file in $xslt
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[ast//xqx:xpathAxis[. = \"$axis\" or . = \"$axis-or-self\"]])" $file`
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(/benchmark/xpath[ast//xqx:xpathAxis[. = \"$axis\" or . = \"$axis-or-self\"]])" $file`
count_xslt=$(($count_xslt+$count))
done
printf $count_xslt
percent=`echo "scale=1; 100*$count_xslt/$total_xslt" | bc`
printf $count_xslt' ('%.1f'\\%%)' $percent
printf ' & '
# XQuery files
count_xquery=0
for file in $xquery
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[ast//xqx:xpathAxis[. = \"$axis\" or . = \"$axis-or-self\"]])" $file`
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(/benchmark/xpath[ast//xqx:xpathAxis[. = \"$axis\" or . = \"$axis-or-self\"]])" $file`
count_xquery=$(($count_xquery+$count))
done
printf $count_xquery
percent=`echo "scale=1; 100*$count_xquery/$total_xquery" | bc`
printf $count_xquery' ('%.1f'\\%%)' $percent
printf ' & '
count_total=$(($count_xslt+$count_xquery))
printf $count_total
percent=`echo "scale=1; 100*$count_total/$total" | bc`
printf $count_total' ('%.1f'\\%%)' $percent
printf ' \\\\\n'
done
printf '\\midrule\n'
printf 'Any axis & '
# XSLT files
count_xslt=0
for file in $xslt
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(/benchmark/xpath[ast//xqx:xpathAxis])" $file`
count_xslt=$(($count_xslt+$count))
done
percent=`echo "scale=1; 100*$count_xslt/$total_xslt" | bc`
printf $count_xslt' ('%.1f'\\%%)' $percent
printf ' & '
# XQuery files
count_xquery=0
for file in $xquery
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(/benchmark/xpath[ast//xqx:xpathAxis])" $file`
count_xquery=$(($count_xquery+$count))
done
percent=`echo "scale=1; 100*$count_xquery/$total_xquery" | bc`
printf $count_xquery' ('%.1f'\\%%)' $percent
printf ' & '
count_total=$(($count_xslt+$count_xquery))
percent=`echo "scale=1; 100*$count_total/$total" | bc`
printf $count_total' ('%.1f'\\%%)' $percent
printf ' \\\\\n'
printf '\\bottomrule\n'
printf '\\end{tabular}\n'
......@@ -3,12 +3,31 @@
xslt=`grep 'xslt' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'`
xquery=`grep 'xquery' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'`
# XSLT queries (total)
total_xslt=0
for file in $xslt
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(/benchmark/xpath)" $file`
total_xslt=$(($total_xslt+$count))
done
# Xquery queries (total)
total_xquery=0
for file in $xquery
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(/benchmark/xpath)" $file`
total_xquery=$(($total_xquery+$count))
done
# Total queries
total=$(($total_xslt+$total_xquery))
printf '\\begin{tabular}{lrrr}\n'
printf '\\toprule\n'
printf 'Operator & XSLT & XQuery & Total \\\\\n'
printf '\\midrule\n'
list=(xpathAxis rootExpr functionCallExpr ifThenElseExpr letExpr forExpr simpleMapExpr dynamicFunctionInvocationExpr inlineFunctionExpr namedFunctionRef quantifiedExpr rangeSequenceExpr instanceOfExpr treatExpr nameTest piTest castableExpr castExpr)
list=(xpathAxis rootExpr functionCallExpr ifThenElseExpr letExpr forExpr simpleMapExpr dynamicFunctionInvocationExpr inlineFunctionExpr namedFunctionRef rangeSequenceExpr instanceOfExpr treatExpr nameTest piTest castableExpr castExpr)
for name in ${list[*]}
do
......@@ -18,22 +37,33 @@ do
count_xslt=0
for file in $xslt
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[ast//xqx:$name])" $file`
if [ $name = "forExpr" ]; then
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(/benchmark/xpath[ast[.//xqx:forExpr or .//xqx:quantifiedExpr]])" $file`
else
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(/benchmark/xpath[ast//xqx:$name])" $file`
fi
count_xslt=$(($count_xslt+$count))
done
printf $count_xslt
percent=`echo "scale=1; 100*$count_xslt/$total_xslt" | bc`
printf $count_xslt' ('%.1f'\\%%)' $percent
printf ' & '
# XQuery files
count_xquery=0
for file in $xquery
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[ast//xqx:$name])" $file`
if [ $name = "forExpr" ]; then
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(/benchmark/xpath[ast[.//xqx:forExpr or .//xqx:quantifiedExpr]])" $file`
else
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(/benchmark/xpath[ast//xqx:$name])" $file`
fi
count_xquery=$(($count_xquery+$count))
done
printf $count_xquery
percent=`echo "scale=1; 100*$count_xquery/$total_xquery" | bc`
printf $count_xquery' ('%.1f'\\%%)' $percent
printf ' & '
count_total=$(($count_xslt+$count_xquery))
printf $count_total
percent=`echo "scale=1; 100*$count_total/$total" | bc`
printf $count_total' ('%.1f'\\%%)' $percent
printf ' \\\\\n'
done
printf '\\bottomrule\n'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment