X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Fmain.ml;h=1981fc2eec5102ff172e4f56d2a63e6b25b10f3c;hb=3627fb7a0e81c5104ab7d776ded6433349194990;hp=3932be697bb3255ed49c3caa5e82f0c119c4c6e7;hpb=4b52da1a20a4fe031930bb96d2ca46bec06dc529;p=SXSI%2Fxpathcomp.git diff --git a/src/main.ml b/src/main.ml index 3932be6..1981fc2 100644 --- a/src/main.ml +++ b/src/main.ml @@ -20,30 +20,6 @@ let tuned_gc = { default_gc with } - -let pr_mat v r = - let () = - Printf.eprintf "Number of nodes in the result set : %i\n%!" - (NodeSet.Mat.length r); - in - if !Options.verbose then Printf.eprintf "Size of result set: %i kb\n" - (Ocaml.size_w r); - match !Options.output_file with - | None -> () - | Some f -> - let fd, finish = - if f = "-" then Unix.stdout, ignore - else - Unix.openfile f [ Unix.O_WRONLY; Unix.O_TRUNC; Unix.O_CREAT ] 0o666, - Unix.close - in - let () = - time ~msg:"Serializing results" - (NodeSet.Mat.iter (fun node -> Tree.print_xml v node fd)) r - in - Tree.flush v fd; - finish fd - let mk_runtime run auto doc arg count print outfile = fun () -> let r = time ~count:1 ~msg:"Execution time" (run auto doc) arg in @@ -69,6 +45,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 @@ -141,6 +119,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) ->