mirror of
https://github.com/c-cube/iter.git
synced 2025-12-06 11:15:32 -05:00
removed deprecated Bench and replace it with Benchmark
This commit is contained in:
parent
7860dbbb95
commit
1e00463cfd
3 changed files with 17 additions and 10 deletions
4
.merlin
4
.merlin
|
|
@ -1,6 +1,8 @@
|
|||
S .
|
||||
S bench/
|
||||
S tests/
|
||||
B _build
|
||||
B _build/tests/
|
||||
B _build/bench/
|
||||
PKG oUnit
|
||||
PKG bench
|
||||
PKG benchmark
|
||||
|
|
|
|||
2
Makefile
2
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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
];
|
||||
()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue