open Benchmark open Utils module SaxonBXQuery : ENGINE = struct let name = "SaxonBXquery" (* Todo call the binary to actually compute the version string *) let description = "SaxonB XQuery engine Java version 1.6.0_0 Saxon 9.0.0.4J from Saxonica" let command = "saxonb-xquery" let reference = false let time_factor = 1.0 let mk_queryfile b doc q out = build_xquery doc q out b let mk_cmdline b qout qfile _ _ = [ "-t" ; "-pipe:push";"-o:"^qout; qfile ] let parse_rules = [ (".*Analysis time: \\([0-9]+\\) milliseconds.*", [ Query_compile_time 1 ]); (".*Tree built in \\([0-9]+\\) milliseconds.*", [ Input_parsing_time 1 ]); (".*Execution time: \\([0-9]+\\) milliseconds.*", [ Query_execution_time 1 ]); ] let reference = false end module XsltProc : ENGINE = struct let name = "XSLTProc" (* Todo call the binary to actually compute the version string *) let description = "xsltproc is a command line tool for applying XSLT stylesheets to XML documents. It is part of libxslt(3), the XSLT C library for GNOME. While it was developed as part of the GNOME project, it can operate independently of the GNOME desktop. Using libxml 20632, libxslt 10124 and libexslt 813 " let command = "xsltproc" let reference = false let time_factor = 1.0 let mk_queryfile b doc q out = build_xslt doc q out b let mk_cmdline b qout qfile doc _ = [ "--timing" ; "-o";qout; qfile; doc ] let parse_rules = [ (".*Parsing stylesheet test.xsl took \\([0-9]+\\) ms.*", [ Query_compile_time 1 ]); (".*Parsing document tiny.xml took \\([0-9]+\\) ms.*", [ Input_parsing_time 1 ]); (".*Running stylesheet and saving result took \\([0-9]+\\) ms.*", [ Query_execution_time 1 ]); ] end module SXSI : ENGINE = struct let name = "SXSI" let description = "" let command = "../main" let reference = false let time_factor = 1.0 let mk_queryfile b doc q out = () let mk_cmdline b qout qfile doc q = [ doc; q ]@ (if b then [qout] else []) let parse_rules = [ ( ".*Parsing document :[ \\t]*\\([0-9]+\\.[0-9]*\\)ms.*", [ Input_parsing_time 1]); ( ".*Compiling query :[ \\t]*\\([0-9]+\\.[0-9]*\\)ms.*", [ Query_compile_time 1]); ( ".*TopDown (No BackTrack) :[ \\t]*\\([0-9]+\\.[0-9]*\\)ms.*", [ Query_execution_time 1]); ( ".*Serializing results :[ \\t]*\\([0-9]+\\.[0-9]*\\)ms.*", [ Serialization_time 1]); ] end module CONF : CONFIGURATION = struct let path = "." let result_basename = "test" let num_runs = 5 let run_with_output = true let run_without_output = true end module I = INIT_TESTER (CONF) module Test = MK (SXSI) (MK (SaxonBXQuery) (I)) let l = Test.test_engine [] (make_queryset ["/home/kim/Documents/Work/Code/xpathcomp/tests/small.xml"] ["/descendant::*/descendant::*/descendant::*"]) ;; List.iter (function (e,d),s -> Printf.printf "\n-------------- %s -----------------" e; Array.iter ( fun i -> print_newline (); print_newline (); print_stats Format.std_formatter i) (List.hd s); Printf.printf "\n----------------------------------------\n" ) l