@@ -5,7 +5,7 @@ use std::path::Path;
5
5
use super :: path:: { Dirs , RelPath } ;
6
6
use super :: prepare:: GitRepo ;
7
7
use 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 } ;
9
9
10
10
static SIMPLE_RAYTRACER_REPO : GitRepo = GitRepo :: github (
11
11
"ebobby" ,
@@ -54,10 +54,7 @@ fn benchmark_simple_raytracer(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
54
54
)
55
55
. unwrap ( ) ;
56
56
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 ( ) ;
61
58
62
59
eprintln ! ( "[BENCH COMPILE] ebobby/simple-raytracer" ) ;
63
60
let cargo_clif =
@@ -83,7 +80,7 @@ fn benchmark_simple_raytracer(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
83
80
) ;
84
81
85
82
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) ;
87
84
88
85
spawn_and_wait ( bench_compile) ;
89
86
@@ -96,7 +93,7 @@ fn benchmark_simple_raytracer(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
96
93
97
94
let mut bench_run = hyperfine_command (
98
95
0 ,
99
- run_runs ,
96
+ bench_runs ,
100
97
None ,
101
98
Path :: new ( "." ) . join ( get_file_name ( "raytracer_cg_llvm" , "bin" ) ) . to_str ( ) . unwrap ( ) ,
102
99
Path :: new ( "." ) . join ( get_file_name ( "raytracer_cg_clif" , "bin" ) ) . to_str ( ) . unwrap ( ) ,
0 commit comments