;;
let total_time () = List.fold_left (+.) 0. !l;;
+let poa = TagSet.add Tag.pcdata (TagSet.singleton Tag.attribute)
+let rec fill_hashtag t =
+ if Tree.Binary.is_node t then
+ begin
+ let tag = Tree.Binary.tag t in
+ let a =
+ if TagSet.mem tag poa
+ then 0
+ else
+ fill_hashtag (Tree.Binary.first_child t)
+ in
+ let b = fill_hashtag (Tree.Binary.next_sibling t)
+ in a+b+1
+ end
+ else 0
+
let test_slashslash tree k =
let test =
in
XPath.Ast.print Format.err_formatter query;
Format.fprintf Format.err_formatter "\n%!";
- Printf.eprintf "Compiling query : ";
+(* Printf.eprintf "Dummy iteration : ";
+ time (fill_hashtag) v;
+ Printf.eprintf "Dummy iteration (tag access cached) : ";
+ time (fill_hashtag) v;
+*)
+ Printf.eprintf "Compiling query : ";
let auto,_ = time XPath.Compile.compile query in
Printf.eprintf "Execution time %s : " (if !Options.count_only then "(counting only)" else "");
begin