File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
crates/cargo-codspeed/src Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,15 @@ fn aggregate_raw_walltime_data(workspace_root: &Path) -> Result<()> {
202
202
return Ok ( ( ) ) ;
203
203
}
204
204
205
+ for bench in & walltime_benchmarks {
206
+ if bench. is_invalid ( ) {
207
+ eprintln ! (
208
+ "Warning: Benchmark {} was possibly optimized away" ,
209
+ bench. name( )
210
+ ) ;
211
+ }
212
+ }
213
+
205
214
let results_folder = std:: env:: var ( "CODSPEED_PROFILE_FOLDER" )
206
215
. map ( PathBuf :: from)
207
216
. unwrap_or_else ( |_| workspace_root. join ( "target/codspeed/profiles" ) )
Original file line number Diff line number Diff line change @@ -41,6 +41,16 @@ pub struct WalltimeBenchmark {
41
41
stats : BenchmarkStats ,
42
42
}
43
43
44
+ impl WalltimeBenchmark {
45
+ pub ( crate ) fn is_invalid ( & self ) -> bool {
46
+ self . stats . min_ns < f64:: EPSILON
47
+ }
48
+
49
+ pub ( crate ) fn name ( & self ) -> & str {
50
+ & self . metadata . name
51
+ }
52
+ }
53
+
44
54
impl From < RawWallTimeData > for WalltimeBenchmark {
45
55
fn from ( value : RawWallTimeData ) -> Self {
46
56
let times_ns: Vec < f64 > = value. times_ns . iter ( ) . map ( |& t| t as f64 ) . collect ( ) ;
You can’t perform that action at this time.
0 commit comments