X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Fmain.ml;h=8c7c81f3cfd3207cf51e3b706b3606087ccac341;hb=b0f6895e9398185757f2587aacf3c47e0c236e32;hp=76e321df2b3e83d61c9a9b8e4b0e9f89c99427ca;hpb=d91456d4929e1e15a3d03bd956d28118aaef7a77;p=SXSI%2Fxpathcomp.git diff --git a/src/main.ml b/src/main.ml index 76e321d..8c7c81f 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 -> () @@ -45,6 +46,8 @@ let main v query_string output = 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 @@ -117,6 +120,7 @@ in (*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) ->