removed deprecated Bench and replace it with Benchmark

This commit is contained in:
Simon Cruanes 2014-05-20 21:56:02 +02:00
parent 7860dbbb95
commit 1e00463cfd
3 changed files with 17 additions and 10 deletions

View file

@ -1,6 +1,8 @@
S . S .
S bench/
S tests/ S tests/
B _build B _build
B _build/tests/ B _build/tests/
B _build/bench/
PKG oUnit PKG oUnit
PKG bench PKG benchmark

View file

@ -41,7 +41,7 @@ configure:
# OASIS_STOP # OASIS_STOP
benchs: all benchs: all
ocamlbuild -use-ocamlfind -pkg bench -pkg benchmark -pkg unix \ ocamlbuild -use-ocamlfind -pkg benchmark -pkg unix \
bench/benchs.native bench/simple_bench.native \ bench/benchs.native bench/simple_bench.native \
bench/bench_persistent.native bench/bench_persistent.native

View file

@ -16,14 +16,19 @@ let bench_product n =
S.product (0 -- n) (0 -- n) (fun (i,j) -> ()) S.product (0 -- n) (0 -- n) (fun (i,j) -> ())
let _ = let _ =
let _ = List.map List.iter
(fun (name,bench) -> (fun (name,bench,sizes) ->
Format.printf "-------------------------------------------------------@."; Format.printf "-------------------------------------------------------@.";
Format.printf "bench %s@." name; Format.printf "bench %s@." name;
bench ();) List.iter
[ "fold", (fun () -> Bench.bench_throughput bench_fold big) ; (fun n ->
"flatmap", (fun () -> Bench.bench_throughput bench_flatmap medium) ; let name = name ^ " on " ^ string_of_int n in
"product", (fun () -> Bench.bench_throughput bench_product small) ; let res = Benchmark.throughput1 2 ~name bench n in
] Benchmark.tabulate res;
in ) sizes
)
[ "fold", bench_fold, big
; "flatmap", bench_flatmap, medium
; "product", bench_product, small
];
() ()