add CCFun_vec to benchmarks

This commit is contained in:
Simon Cruanes 2018-02-15 00:27:04 -06:00
parent ccad1f3a2c
commit deb266e1b3

View file

@ -110,14 +110,18 @@ module L = struct
let bench_nth ?(time=2) n = let bench_nth ?(time=2) n =
let l = CCList.(1 -- n) in let l = CCList.(1 -- n) in
let ral = CCRAL.of_list l in let ral = CCRAL.of_list l in
let v = CCFun_vec.of_list l in
let bench_list l () = let bench_list l () =
for i = 0 to n-1 do ignore (List.nth l i) done for i = 0 to n-1 do Sys.opaque_identity (ignore (List.nth l i)) done
and bench_ral l () = and bench_ral l () =
for i = 0 to n-1 do ignore (CCRAL.get_exn l i) done 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
in in
B.throughputN time ~repeat B.throughputN time ~repeat
[ "List.nth", bench_list l, () [ "List.nth", bench_list l, ()
; "RAL.get", bench_ral ral, () ; "RAL.get", bench_ral ral, ()
; "funvec.get", bench_funvec v, ()
] ]
(* MAIN *) (* MAIN *)