File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ open Kcas
2+ open Bench
3+
4+ let run_one ?(factor = 1 ) ?(n_iter = 25 * factor * Util. iter_factor) () =
5+ let loc = Loc. make 0 in
6+
7+ let init _ = () in
8+ let work _ () =
9+ let rec loop i =
10+ if i > 0 then begin
11+ Loc. incr loc;
12+ loop (i - 1 )
13+ end
14+ in
15+ loop n_iter
16+ in
17+
18+ let times = Times. record ~n_domains: 1 ~init ~work () in
19+
20+ List. concat
21+ [
22+ Stats. of_times times
23+ |> Stats. scale (1_000_000_000.0 /. Float. of_int n_iter)
24+ |> Stats. to_json ~name: " time per op/incr"
25+ ~description: " Time to perform a single op" ~units: " ns" ;
26+ Times. invert times |> Stats. of_times
27+ |> Stats. scale (Float. of_int n_iter /. 1_000_000.0 )
28+ |> Stats. to_json ~name: " ops over time/incr"
29+ ~description: " Number of operations performed over time" ~units: " M/s" ;
30+ ]
31+
32+ let run_suite ~factor = run_one ~factor ()
Original file line number Diff line number Diff line change 11let benchmarks =
22 [
3+ (" Kcas Loc" , Bench_loc. run_suite);
34 (" Kcas Op" , Bench_op. run_suite);
45 (" Kcas Xt" , Bench_xt. run_suite);
56 (" Kcas parallel CMP" , Bench_parallel_cmp. run_suite);
You can’t perform that action at this time.
0 commit comments