(** PROFILING *)
-let profiling_enabled = false ;; (* ComponentsConf.profiling *)
+let profiling_enabled = ref true ;; (* ComponentsConf.profiling *)
let something_profiled = ref false
type profiler = { profile : 'a 'b. ('a -> 'b) -> 'a -> 'b }
let profile ?(enable = true) s =
- if profiling_enabled && enable then
+ if !profiling_enabled && enable then
let total = ref 0.0 in
let calls = ref 0 in
let max = ref 0.0 in
let profile f x =
+ if not !profiling_enabled then f x else
let before = Unix.gettimeofday () in
try
incr calls;
try
if (Unix.stat path).Unix.st_kind = Unix.S_REG then path
else aux tl
- with Unix.Unix_error _ as exn ->
+ with Unix.Unix_error _ ->
aux tl
in
try