From 1e00463cfdf5be5e3cb6acc1ca30cb5c8ccf85eb Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 20 May 2014 21:56:02 +0200 Subject: [PATCH] removed deprecated Bench and replace it with Benchmark --- .merlin | 4 +++- Makefile | 2 +- bench/benchs.ml | 21 +++++++++++++-------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.merlin b/.merlin index 4ac5fc8..385d469 100644 --- a/.merlin +++ b/.merlin @@ -1,6 +1,8 @@ S . +S bench/ S tests/ B _build B _build/tests/ +B _build/bench/ PKG oUnit -PKG bench +PKG benchmark diff --git a/Makefile b/Makefile index b661dba..32befb4 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ configure: # OASIS_STOP 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/bench_persistent.native diff --git a/bench/benchs.ml b/bench/benchs.ml index d85eca6..af8b5db 100644 --- a/bench/benchs.ml +++ b/bench/benchs.ml @@ -16,14 +16,19 @@ let bench_product n = S.product (0 -- n) (0 -- n) (fun (i,j) -> ()) let _ = - let _ = List.map - (fun (name,bench) -> + List.iter + (fun (name,bench,sizes) -> Format.printf "-------------------------------------------------------@."; Format.printf "bench %s@." name; - bench ();) - [ "fold", (fun () -> Bench.bench_throughput bench_fold big) ; - "flatmap", (fun () -> Bench.bench_throughput bench_flatmap medium) ; - "product", (fun () -> Bench.bench_throughput bench_product small) ; - ] - in + List.iter + (fun n -> + let name = name ^ " on " ^ string_of_int n in + let res = Benchmark.throughput1 2 ~name bench n in + Benchmark.tabulate res; + ) sizes + ) + [ "fold", bench_fold, big + ; "flatmap", bench_flatmap, medium + ; "product", bench_product, small + ]; ()