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 -> ()
time ~msg:"Compiling query" (Compile.compile) query
in
if !Options.verbose then Ata.print Format.err_formatter auto;
+ Gc.full_major();
+ Gc.compact();
Gc.set (tuned_gc);
let runtime =
match !Options.bottom_up, bu_info with
;;
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"
(*Printexc.record_backtrace true; *)
main document !Options.query !Options.output_file;
if !Options.verbose then Printf.eprintf "Maximum resident set size: %s\n" (read_procmem());
+ Gc.full_major();
Profile.summary Format.err_formatter
with
| Ulexer.Loc.Exc_located ((x,y),e) ->