X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=unit_test.ml;h=ff8d573c1e09feb0a1bc5edf6c8078c9b43f7045;hb=52101d20031fd52639753282519b8a45e26ecb5d;hp=f6cf23a56214ce62e437b6308de74435e0922273;hpb=dc91851aaeac91a71eba2c266d0227adea0c5815;p=SXSI%2Fxpathcomp.git diff --git a/unit_test.ml b/unit_test.ml index f6cf23a..ff8d573 100644 --- a/unit_test.ml +++ b/unit_test.ml @@ -29,21 +29,23 @@ then let doc = - try - Tree.Binary.parse_xml_uri Sys.argv.(1) - with - | _ ->( try Tree.Binary.load Sys.argv.(1) with | _ -> - Printf.printf "Error parsing document\n"; - exit 2) + ( try + Tree.Binary.parse_xml_uri Sys.argv.(1) + with + | _ ->( + + Printf.printf "Error parsing document\n"; + exit 2)) ;; let _ = Tag.init (Tree.Binary.tag_pool doc) ;; -let tags = (collect_tags doc) -;; +(* + let tags = (collect_tags doc) + ;; (* let _ = Tree.Binary.test_xml_tree Format.std_formatter tags doc ;; @@ -130,7 +132,7 @@ let _ = Printf.printf "==> %i nodes\n" (Ata.TS.length r) (* let _ = Ata.TS.iter (fun t -> Tree.Binary.print_xml_fast stdout t; print_newline();) r *) ;; -*) +*) *) let time f x = let t1 = Unix.gettimeofday () in let r = f x in @@ -139,5 +141,8 @@ let time f x = Printf.eprintf " %fms\n%!" t ; r ;; +let _ = Printf.eprintf "Timing full //keyword ... " +let x = List.length (time (Tree.Binary.time_xml_tree doc) (Tag.tag "keyword")) let _ = Printf.eprintf "Timing jump //keyword ... " -let _ = time Tree.Binary.test_jump doc (Tag.tag "keyword") +let y = List.length (time (Tree.Binary.time_xml_tree2 doc) (Tag.tag "keyword")) +let _ = Printf.eprintf "coherant : %b\n" (x=y)