.
authorkim <kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Fri, 30 Jan 2009 05:24:49 +0000 (05:24 +0000)
committerkim <kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Fri, 30 Jan 2009 05:24:49 +0000 (05:24 +0000)
git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/xpathcomp@97 3cdefd35-fc62-479d-8e8d-bae585ffb9ca

benchmark/benchmark.ml
benchmark/config.ml [deleted file]
benchmark/config.ml.in [new file with mode: 0644]
benchmark/main.ml

index 5418b64..c726166 100644 (file)
@@ -258,10 +258,10 @@ struct
                                 else Printf.printf "With output : \t%!";
                                 for i = 1 to Conf.num_runs do
                                   let s = extract(run_query (k==1) (j==1) qnum docnum qset) in
-                                    if sres.(j).query_execution_time > s.query_execution_time
-                                    then sres.(j) <- s;
-                                    if (k==1) then
-                                      sres.(j).memory_usage <- s.memory_usage;
+                                    sres.(j).query_execution_time <- s.query_execution_time;
+                                    sres.(j).query_compile_time <- s.query_compile_time;
+                                    if j == 1 then sres.(j).serialization_time <- s.serialization_time;
+                                    if k == 1 then sres.(j).memory_usage <- s.memory_usage;
                                     Printf.printf "pass %i ... %!" i;
                                 done;
                                 Printf.printf "Ok\n%!";                       
diff --git a/benchmark/config.ml b/benchmark/config.ml
deleted file mode 100644 (file)
index 422c0c4..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-(* semi-colon separated list of input documents *)
-let documents = [ "../tests/tiny.xml" ]
-
-(* semi-colon separated list of XPath queries *)
-let queries = [ "//para[ contains(.,\"international\") ]//acronym"; "//*//*//*//*"; "/*"; "//part//text()" ]
-
-
-(* I is the initial configuration
- * MK (engine) (configuration) gives a new configuration
- * valid engines are SXSI and SaxonBXQuery
- * ex: if you only want to test SaxonBXQuery :
- * module TEST = MK (SaxonBXQuery) (I)
- *)
-
-module CONF : CONFIGURATION = 
-struct
-  let path = "output"
-  let result_basename = "test"
-  let num_runs = 2
-  let run_with_output = true
-  let run_without_output = true
-end
-
-module I = INIT_TESTER (CONF)
-
-module TEST = 
-  MK (SXSI) 
-    (MK (XsltProc) 
-       (MK (QizxOpen) 
-         (MK (SaxonBXQuery) (I))))
-
diff --git a/benchmark/config.ml.in b/benchmark/config.ml.in
new file mode 100644 (file)
index 0000000..5d63b48
--- /dev/null
@@ -0,0 +1,29 @@
+(* semi-colon separated list of input documents *)
+let documents = [ "../tests/tiny.xml" ]
+
+(* semi-colon separated list of XPath queries *)
+let queries = [ "//*" ]
+
+
+(* I is the initial configuration
+ * MK (engine) (configuration) gives a new configuration
+ * valid engines are SXSI and SaxonBXQuery
+ * ex: if you only want to test SaxonBXQuery :
+ * module TEST = MK (SaxonBXQuery) (I)
+ *)
+
+module CONF : CONFIGURATION = 
+struct
+  let path = "output"
+  let result_basename = "test"
+  let num_runs = 2
+  let run_with_output = true
+  let run_without_output = true
+end
+
+module I = INIT_TESTER (CONF)
+
+module TEST = 
+  MK (SXSI) 
+         (MK (SaxonBXQuery) (I))
+
index 111f421..b80faed 100644 (file)
@@ -114,9 +114,10 @@ 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.iter ( fun i ->
+                                        print_newline ();
+                                        print_newline ();
+                                        print_stats Format.std_formatter i) k) s;
             Printf.printf "\n----------------------------------------\n"
          ) l