projects
/
tatoo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactor the statistics gathering code in run.ml
[tatoo.git]
/
src
/
tatoo.ml
diff --git
a/src/tatoo.ml
b/src/tatoo.ml
index
6464cb4
..
e0f29ee
100644
(file)
--- a/
src/tatoo.ml
+++ b/
src/tatoo.ml
@@
-15,8
+15,6
@@
open Format
open Format
-
-
let time f arg msg =
let t1 = Unix.gettimeofday () in
let r = f arg in
let time f arg msg =
let t1 = Unix.gettimeofday () in
let r = f arg in
@@
-106,9
+104,10
@@
let main () =
Logger.msg `STATS "@[Automaton: @\n%a@]" Ata.print auto) auto_list;
end;
Logger.msg `STATS "@[Automaton: @\n%a@]" Ata.print auto) auto_list;
end;
- let module Naive = Run.Make(Naive_tree) in
+ let module Naive = Run.Make(Naive_tree)
(Naive_node_list)
in
let result_list =
let result_list =
- let root = [ Naive_tree.root doc] in
+ let root = Naive_node_list.create () in
+ let () = Naive_node_list.add (Naive_tree.root doc) root in
let f, msg =
match !Options.parallel, !Options.compose with
true, true ->
let f, msg =
match !Options.parallel, !Options.compose with
true, true ->
@@
-125,10
+124,13
@@
let main () =
let s = Naive.stats () in
Run.(
Logger.msg `STATS
let s = Naive.stats () in
Run.(
Logger.msg `STATS
- "@[tree size: %d@\ntraversals: %d@\ntransition fetch cache hit ratio: %f@\ntransition eval cache hit ratio: %f@]"
- s.tree_size s.
run
+ "@[tree size: %d@\ntraversals: %d@\ntransition fetch cache hit ratio: %f@\ntransition eval cache hit ratio: %f@
\nNumber of visited nodes per pass: %a@
]"
+ s.tree_size s.
pass
(float s.fetch_trans_cache_hit /. float s.fetch_trans_cache_access)
(float s.fetch_trans_cache_hit /. float s.fetch_trans_cache_access)
- (float s.eval_trans_cache_hit /. float s.eval_trans_cache_access));
+ (float s.eval_trans_cache_hit /. float s.eval_trans_cache_access)
+ (let i = ref 0 in
+ Pretty.print_list ~sep:"," (fun fmt n -> Format.fprintf fmt "%i: %i" !i n;incr i))
+ s.nodes_per_run);
time (fun () ->
let count = ref 1 in
List.iter (fun results ->
time (fun () ->
let count = ref 1 in
List.iter (fun results ->
@@
-136,10
+138,10
@@
let main () =
output_string output (string_of_int !count);
output_string output "\" >\n";
if !Options.count then begin
output_string output (string_of_int !count);
output_string output "\" >\n";
if !Options.count then begin
- output_string output (string_of_int (
L
ist.length results));
+ output_string output (string_of_int (
Naive_node_l
ist.length results));
output_char output '\n';
end else
output_char output '\n';
end else
-
L
ist.iter (fun n ->
+
Naive_node_l
ist.iter (fun n ->
Naive_tree.print_xml output doc n;
output_char output '\n'
) results;
Naive_tree.print_xml output doc n;
output_char output '\n'
) results;