let reference = false
let time_factor = 1.0
let mk_queryfile b doc q out = ()
- let mk_cmdline b qout qfile doc q = [ doc; q ]@ (if b then [qout] else [])
+ let mk_cmdline b qout qfile doc q = [ "-d"; doc; q ]@ (if b then [qout] else [])
let parse_rules =
[ ( ".*Parsing document :[ \\t]*\\([0-9]+\\.[0-9]*\\)ms.*",
[ Input_parsing_time 1]);
DEFINE D(x) = ignore(x);
-DEFINE MM(v,l) = Memory.register v (Loc.to_string (l))
+DEFINE MM(v,l) = (let ____x = v in (Memory.register ____x (Loc.to_string (l)));____x)
let () = Memory.schedule_stats ()
ELSE
DEFINE D(x) = ();
-DEFINE MM(v,l) = ()
+DEFINE MM(v,l) = (v)
END (* IFDEF DEBUG *)
) ()
in
let _ = Tag.init (Tree.Binary.tag_pool v) in
- MM(v,__LOCATION__);
Printf.eprintf "Parsing query : ";
let query = try
time
main !Options.input_file !Options.query !Options.output_file;;
+IFDEF DEBUG
+THEN
Printf.eprintf "\n=================================================\nDEBUGGING\n%!";
Tree.DEBUGTREE.print_stats Format.err_formatter;;
Gc.full_major()
+ENDIF
(* Copyright NICTA 2008 *)
(* Distributed under the terms of the LGPL (see LICENCE) *)
(******************************************************************************)
+INCLUDE "debug.ml"
module type BINARY =
sig
type node_content
let parse_xml_uri str = node_of_t
- (parse_xml_uri str
- !Options.sample_factor !Options.index_empty_texts !Options.disable_text_collection)
+ (MM((parse_xml_uri str
+ !Options.sample_factor
+ !Options.index_empty_texts
+ !Options.disable_text_collection),__LOCATION__))
let parse_xml_string str = node_of_t
- (parse_xml_string str
- !Options.sample_factor !Options.index_empty_texts !Options.disable_text_collection)
+ (MM((parse_xml_string str
+ !Options.sample_factor
+ !Options.index_empty_texts
+ !Options.disable_text_collection),__LOCATION__))
external pool : doc -> Tag.pool = "%identity"
-
-
+IFDEF DEBUG
+THEN
module DEBUGTREE
= struct
end
module Binary = DEBUGTREE
+ELSE
+module Binary = XML.Binary
+END (* IFDEF DEBUG *)