@@ -5,7 +5,7 @@ use std::path::Path;
55use super :: path:: { Dirs , RelPath } ;
66use super :: prepare:: GitRepo ;
77use super :: rustc_info:: get_file_name;
8- use super :: utils:: { hyperfine_command, is_ci , spawn_and_wait, CargoProject , Compiler } ;
8+ use super :: utils:: { hyperfine_command, spawn_and_wait, CargoProject , Compiler } ;
99
1010static SIMPLE_RAYTRACER_REPO : GitRepo = GitRepo :: github (
1111 "ebobby" ,
@@ -54,10 +54,7 @@ fn benchmark_simple_raytracer(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
5454 )
5555 . unwrap ( ) ;
5656
57- let run_runs = env:: var ( "RUN_RUNS" )
58- . unwrap_or ( if is_ci ( ) { "2" } else { "10" } . to_string ( ) )
59- . parse ( )
60- . unwrap ( ) ;
57+ let bench_runs = env:: var ( "BENCH_RUNS" ) . unwrap_or_else ( |_| "10" . to_string ( ) ) . parse ( ) . unwrap ( ) ;
6158
6259 eprintln ! ( "[BENCH COMPILE] ebobby/simple-raytracer" ) ;
6360 let cargo_clif =
@@ -83,7 +80,7 @@ fn benchmark_simple_raytracer(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
8380 ) ;
8481
8582 let bench_compile =
86- hyperfine_command ( 1 , run_runs , Some ( & clean_cmd) , & llvm_build_cmd, & clif_build_cmd) ;
83+ hyperfine_command ( 1 , bench_runs , Some ( & clean_cmd) , & llvm_build_cmd, & clif_build_cmd) ;
8784
8885 spawn_and_wait ( bench_compile) ;
8986
@@ -96,7 +93,7 @@ fn benchmark_simple_raytracer(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
9693
9794 let mut bench_run = hyperfine_command (
9895 0 ,
99- run_runs ,
96+ bench_runs ,
10097 None ,
10198 Path :: new ( "." ) . join ( get_file_name ( "raytracer_cg_llvm" , "bin" ) ) . to_str ( ) . unwrap ( ) ,
10299 Path :: new ( "." ) . join ( get_file_name ( "raytracer_cg_clif" , "bin" ) ) . to_str ( ) . unwrap ( ) ,
0 commit comments