- let auto = time XPath.Compile.compile query in
- XPath.Ast.print Format.err_formatter query;
- Format.eprintf "\n%!";
-(* Format.eprintf "Internal rep of the tree is :\n%!";
- Tree.Binary.dump v; *)
- Printf.eprintf "Execution time : ";
- time (fun v -> ignore (TopDown.accept auto v)) v;
- Printf.eprintf "Number of nodes in the result set : %i\n" (BST.cardinal auto.result);
+ let auto,ltags,contains = time XPath.Compile.compile query in
+ let _ = Ata.dump Format.err_formatter auto in
+ let _ = Printf.eprintf "%!" in
+
+ let do_contains = match contains with
+ None -> false
+ | Some s ->
+ let r = Tree.count v s
+ in
+ Printf.eprintf "%i documents in the TextCollection\n" (Tree.text_size v);
+ Printf.eprintf "Global count is %i, using " r;
+ if r < !Options.tc_threshold then begin
+ Printf.eprintf "TextCollection contains\nTiming call to raw global contains (1st time): ";
+ time (Tree.unsorted_contains v) s;
+ Printf.eprintf "Calling global contains : ";
+ time (Tree.init_contains v) s;
+ Printf.eprintf "Timing call to global count contains : ";
+ let r = time (Tree.count_contains v) s
+ in
+ Printf.eprintf " number of matching nodes %i \n%!" r;
+ Printf.eprintf "Timing call to raw global contains (2nd time): ";
+ time (Tree.unsorted_contains v) s;
+ end
+ else begin
+ Printf.eprintf "Naive contains\nCalling global contains : ";
+ time (Tree.init_naive_contains v) s
+ end;true
+ in
+ Printf.eprintf "Execution time %s : "
+ (if !Options.count_only then "(counting only)" else if !Options.backward then "(bottomup)" else "");