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 @@ -209,6 +209,15 @@ fn aggregate_raw_walltime_data(workspace_root: &Path) -> Result<()> {
209209 return Ok ( ( ) ) ;
210210 }
211211
212+ for bench in & walltime_benchmarks {
213+ if bench. is_invalid ( ) {
214+ eprintln ! (
215+ "Warning: Benchmark {} was possibly optimized away" ,
216+ bench. name( )
217+ ) ;
218+ }
219+ }
220+
212221 let results_folder = std:: env:: var ( "CODSPEED_PROFILE_FOLDER" )
213222 . map ( PathBuf :: from)
214223 . 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 {
4141 stats : BenchmarkStats ,
4242}
4343
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+
4454impl From < RawWallTimeData > for WalltimeBenchmark {
4555 fn from ( value : RawWallTimeData ) -> Self {
4656 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