Skip to content

Commit

Permalink
Run clean rebuilds 5 times for statistical "rigor"
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg committed Apr 22, 2021
1 parent 3cb7751 commit 0c9abf1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bench/bench.ml
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,16 @@ let () =
let clean, _ =
with_timer (fun () -> Sys.command "dune build @all --root .")
in
let zero, _ = with_timer (fun () -> Sys.command "dune build @all --root .") in
let zeros =
List.init 5 ~f:(fun _ ->
let time, _ =
with_timer (fun () -> Sys.command "dune build @all --root .")
in
time)
in
let results =
[ { Output.name = "clean_build"; metrics = [ ("time", `Float clean) ] }
; { Output.name = "zero_build"; metrics = [ ("time", `Float zero) ] }
; { Output.name = "zero_build"; metrics = [ ("time", `List zeros) ] }
]
in
let output = { Output.config = []; results } in
Expand Down

0 comments on commit 0c9abf1

Please sign in to comment.