X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Fmain.ml;h=cd3d275db15c65f3e40ce4dd19c8160b36447273;hb=124b3b4e8f440f8c996263127336377c9456e090;hp=1981fc2eec5102ff172e4f56d2a63e6b25b10f3c;hpb=813b239795aac1844eb233dab7f8f98d8dba845e;p=SXSI%2Fxpathcomp.git diff --git a/src/main.ml b/src/main.ml index 1981fc2..cd3d275 100644 --- a/src/main.ml +++ b/src/main.ml @@ -19,10 +19,11 @@ let tuned_gc = { default_gc with Gc.space_overhead = 100; } - let mk_runtime run auto doc arg count print outfile = fun () -> + if !Options.do_perf then start_perf (); let r = time ~count:1 ~msg:"Execution time" (run auto doc) arg in + if !Options.do_perf then stop_perf (); Printf.eprintf "Number of results: %i\n%!" (count r); match outfile with None -> () @@ -90,7 +91,13 @@ let () = Options.parse_cmdline() ;; let document = - if Filename.check_suffix !Options.input_file ".srx" + if Filename.check_suffix !Options.input_file ".g.bin" then + let g = time ~msg:"Loading grammar" (Grammar.load !Options.input_file) true in + begin + ignore(g); + exit 0 + end + else if Filename.check_suffix !Options.input_file ".srx" then time ~msg:"Loading file"