- in
- Format.fprintf ppf
- "Timing : Function Name, number of calls,%% of total calls, mean time, total time, %% of total time\n%!";
- Hashtbl.iter (fun name (time,count) ->
- Format.fprintf ppf "%-27s% 8d\t% 4.2f%%\t% 4.6f ms\t% 4.6f ms\t%04.2f%%\n%!"
- name
- count
- (100. *. (float_of_int count)/.(float_of_int total_calls))
- (time /. (float_of_int count))
- time
- (100. *. time /. total_time)) _timings;
- Format.fprintf ppf "-------------------------------------------------------------------\n";
- Format.fprintf ppf "%-27s% 8d\t% 4.0f%%\t########## ms\t% 4.6f ms\t% 4.0f%%\n%!"
- "Total" total_calls 100. total_time 100.
-
-
- let print_xml_fast outc t =
- let rec loop ?(print_right=true) t = match t.node with
- | Nil -> ()
- | String (s) -> output_string outc (string t)
- | Node _ when Tag.equal (tag t) Tag.pcdata -> loop (left t); loop (right t)
-
- | Node (_) ->
- let tg = Tag.to_string (tag t) in
- let l = left t
- and r = right t
- in
- output_char outc '<';
- output_string outc tg;
- ( match l.node with
- Nil -> output_string outc "/>"
- | String _ -> assert false
- | Node(_) when Tag.equal (tag l) Tag.attribute ->
- (loop_attributes (left l);
- match (right l).node with
- | Nil -> output_string outc "/>"
- | _ ->
- output_char outc '>';
- loop (right l);
- output_string outc "</";
- output_string outc tg;
- output_char outc '>' )
- | _ ->
- output_char outc '>';
- loop l;
- output_string outc "</";
- output_string outc tg;
- output_char outc '>'
- );if print_right then loop r
- and loop_attributes a =