Implement a new automaton run (non optimized) with cleaner semantics w.r.t. ranked...
[tatoo.git] / src / tatoo.ml
index 57d5f1a..eac804a 100644 (file)
@@ -53,7 +53,6 @@ let main () =
     let d = time Naive_tree.load_xml_file fd "parsing xml document" in
     close_fd (); d
   in
-  let () = Gc.compact () in
   let queries =
     time
       (fun l ->
@@ -107,7 +106,8 @@ let main () =
 
   let module Naive = Run.Make(Naive_tree) in
   let result_list =
-    let root = [ Naive_tree.root doc] in
+    let root = Sequence.create () in
+    let () = Sequence.add (Naive_tree.root doc) root in
     let f, msg =
       match !Options.parallel, !Options.compose with
         true, true ->
@@ -121,13 +121,6 @@ let main () =
     in
     time f () ("evaluating query in " ^ msg ^ " mode")
   in
-  let s = Naive.stats () in
-  Run.(
-  Logger.msg `STATS
-    "@[tree size: %d@\ntraversals: %d@\ntransition fetch cache hit ratio: %f@\ntransition eval cache hit ratio: %f@]"
-    s.tree_size s.run
-    (float s.fetch_trans_cache_hit /. float s.fetch_trans_cache_access)
-    (float s.eval_trans_cache_hit /. float s.eval_trans_cache_access));
   time (fun () ->
     let count = ref 1 in
     List.iter (fun results ->
@@ -135,10 +128,10 @@ let main () =
       output_string output (string_of_int !count);
       output_string output "\" >\n";
       if !Options.count then begin
-        output_string output (string_of_int (List.length results));
+        output_string output (string_of_int (Sequence.length results));
         output_char output '\n';
       end else
-        List.iter (fun n ->
+        Sequence.iter (fun n ->
           Naive_tree.print_xml output doc n;
           output_char output '\n'
         ) results;