X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=main.ml;h=82642787af6ee6b0c62a1b7de61c485a83a17490;hb=a7dc14cd894ab8ecc34a3f47db0150232950e5b7;hp=c446ef39f2eef515f619a41ed90e13490fdbe743;hpb=dc91851aaeac91a71eba2c266d0227adea0c5815;p=SXSI%2Fxpathcomp.git diff --git a/main.ml b/main.ml index c446ef3..8264278 100644 --- a/main.ml +++ b/main.ml @@ -43,14 +43,25 @@ let main v query output = let _ = Printf.eprintf "%!" in let _ = match contains with None -> () - | Some s -> Tree.Binary.init_contains v s + | Some s -> + let r = Tree.Binary.count v s + in + Printf.eprintf "Global count is %i, using " r; + if r < 60000 then begin + Printf.eprintf "TextCollection contains\nCalling global contains : "; + time (Tree.Binary.init_contains v) s + end + else begin + Printf.eprintf "Naive contains\nCalling global contains : "; + time (Tree.Binary.init_naive_contains v) s + end in Printf.eprintf "Execution time %s : " (if !Options.count_only then "(counting only)" else ""); begin if !Options.count_only then failwith "Count only not implemented in this version" else - let _ = Gc.set ({ Gc.get() with Gc.max_overhead = 1000000; Gc.space_overhead = 100 }) in + (* let _ = Gc.set ({ Gc.get() with Gc.max_overhead = 1000000; Gc.space_overhead = 100 }) in *) let result = time (if !Options.time then run_time auto else run auto) v in Printf.eprintf "Number of nodes in the result set : %i\n" (TS.length result); Printf.eprintf "\n%!";