@@ -545,8 +545,8 @@ impl BenchmarkVariance {
545
545
const SIGNFICANT_DELTA_THRESHOLD : f64 = 0.01 ;
546
546
/// The percentage of significant changes that we consider too high
547
547
const SIGNFICANT_CHANGE_THRESHOLD : f64 = 5.0 ;
548
- /// The percentage of change that constitutes noisy data
549
- const NOISE_THRESHOLD : f64 = 0.1 ;
548
+ /// The ratio of change that constitutes noisy data
549
+ const NOISE_THRESHOLD : f64 = 0.001 ;
550
550
551
551
fn push ( & mut self , value : f64 ) {
552
552
self . data . push ( value) ;
@@ -580,26 +580,24 @@ impl BenchmarkVariance {
580
580
) ;
581
581
582
582
if percent_significant_changes > Self :: SIGNFICANT_CHANGE_THRESHOLD {
583
- self . description =
584
- BenchmarkVarianceDescription :: HighlyVariable ( percent_significant_changes) ;
583
+ self . description = BenchmarkVarianceDescription :: HighlyVariable ;
585
584
return ;
586
585
}
587
586
588
587
let delta_mean =
589
588
non_significant. iter ( ) . map ( |( & d, _) | d) . sum :: < f64 > ( ) / ( non_significant. len ( ) as f64 ) ;
590
- let percent_change = ( delta_mean / results_mean) * 100.0 ;
591
- debug ! ( "Percent change: {:.3}% " , percent_change ) ;
592
- if percent_change > Self :: NOISE_THRESHOLD {
593
- self . description = BenchmarkVarianceDescription :: Noisy ( percent_change ) ;
589
+ let ratio_change = delta_mean / results_mean;
590
+ debug ! ( "Ratio change: {:.3}" , ratio_change ) ;
591
+ if ratio_change > Self :: NOISE_THRESHOLD {
592
+ self . description = BenchmarkVarianceDescription :: Noisy ;
594
593
}
595
594
}
596
595
597
596
/// Whether we can trust this benchmark or not
598
597
fn is_dodgy ( & self ) -> bool {
599
598
matches ! (
600
599
self . description,
601
- BenchmarkVarianceDescription :: Noisy ( _)
602
- | BenchmarkVarianceDescription :: HighlyVariable ( _)
600
+ BenchmarkVarianceDescription :: Noisy | BenchmarkVarianceDescription :: HighlyVariable
603
601
)
604
602
}
605
603
}
@@ -610,14 +608,10 @@ pub enum BenchmarkVarianceDescription {
610
608
Normal ,
611
609
/// A highly variable benchmark that produces many significant changes.
612
610
/// This might indicate a benchmark which is very sensitive to compiler changes.
613
- ///
614
- /// Cotains the percentage of significant changes.
615
- HighlyVariable ( f64 ) ,
611
+ HighlyVariable ,
616
612
/// A noisy benchmark which is likely to see changes in performance simply between
617
613
/// compiler runs.
618
- ///
619
- /// Contains the percent change that happens on average
620
- Noisy ( f64 ) ,
614
+ Noisy ,
621
615
}
622
616
623
617
impl Default for BenchmarkVarianceDescription {
@@ -668,7 +662,7 @@ impl TestResultComparison {
668
662
669
663
/// The amount of relative change considered significant when
670
664
/// the test case is dodgy
671
- const SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD_DODGY : f64 = 1.0 ;
665
+ const SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD_DODGY : f64 = 0.01 ;
672
666
673
667
fn log_change ( & self ) -> f64 {
674
668
let ( a, b) = self . results ;
0 commit comments