cherry pick from local- branch
[SXSI/xpathcomp.git] / benchmark / main.ml
index fff21c3..365832f 100644 (file)
@@ -27,6 +27,26 @@ Saxon 9.0.0.4J from Saxonica"
   let reference = false
 end
 
+module QizxOpen : ENGINE =
+struct
+  let name = "QizxOpen"
+
+    (* Todo call the binary to actually compute the version string *)
+  let description = 
+"QizX/Open v2.1
+Java version 1.6.0_0"
+  let command = "/usr/local/qizxopen-2.1/bin/qizx"
+  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 _ _ = [ "-v" ; "-out"^ (if b then qout else "/dev/null");"-q"; qfile ]
+  let parse_rules = [  
+    (".*display time: \\([0-9]+\\) ms.*",
+     [ Query_execution_time 1 ]);
+  ]
+  let reference = false
+end
+
 module XsltProc : ENGINE =
 struct
   let name = "XSLTProc"
@@ -94,9 +114,13 @@ let l = TEST.test_engine [] (make_queryset
 
 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);
+            List.iter (fun k -> 
+                         Array.iteri ( fun i f ->
+                                        if (CONF.run_with_output && i=1) || (CONF.run_without_output && i = 0)
+                                        then begin
+                                        print_newline ();
+                                        print_stats Format.std_formatter f;
+                                        end
+                                        ) k) s;
             Printf.printf "\n----------------------------------------\n"
          ) l