From 0c9abf16cd8f2b74032c94acaf58b5a3e1178140 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 22 Apr 2021 11:21:54 -0700 Subject: [PATCH] Run clean rebuilds 5 times for statistical "rigor" Signed-off-by: Rudi Grinberg --- bench/bench.ml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bench/bench.ml b/bench/bench.ml index 34afbaa81d17..ee1d70efa3e4 100644 --- a/bench/bench.ml +++ b/bench/bench.ml @@ -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