diff --git a/benchs/jbuild b/benchs/jbuild index 957f0ed2..c0c4c2f4 100644 --- a/benchs/jbuild +++ b/benchs/jbuild @@ -2,7 +2,8 @@ (executables ((names (run_benchs run_bench_hash)) (libraries (containers containers.data containers.iter - containers.thread benchmark gen sequence qcheck)) + containers.thread benchmark gen sequence qcheck + batteries)) (flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -color always)) (ocamlopt_flags (:standard -O3 -color always -unbox-closures -unbox-closures-factor 20)) diff --git a/benchs/run_benchs.ml b/benchs/run_benchs.ml index 362a2933..93e96782 100644 --- a/benchs/run_benchs.ml +++ b/benchs/run_benchs.ml @@ -111,17 +111,21 @@ module L = struct let l = CCList.(1 -- n) in let ral = CCRAL.of_list l in let v = CCFun_vec.of_list l in + let bv = BatVect.of_list l in let bench_list l () = for i = 0 to n-1 do Sys.opaque_identity (ignore (List.nth l i)) done and bench_ral l () = for i = 0 to n-1 do Sys.opaque_identity (ignore (CCRAL.get_exn l i)) done and bench_funvec l () = for i = 0 to n-1 do Sys.opaque_identity (ignore (CCFun_vec.get_exn i l)) done + and bench_batvec l () = + for i = 0 to n-1 do Sys.opaque_identity (ignore (BatVect.get l i)) done in B.throughputN time ~repeat [ "List.nth", bench_list l, () ; "RAL.get", bench_ral ral, () ; "funvec.get", bench_funvec v, () + ; "batvec.get", bench_batvec bv, () ] (* MAIN *)