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 .
|
||||||
|
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
|
||||||
|
|
|
||||||
2
Makefile
2
Makefile
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
];
|
||||||
()
|
()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue