@@ -161,13 +161,10 @@ impl ComparisonSummary {
161
161
162
162
/// The direction of the changes
163
163
pub fn direction ( & self ) -> Option < Direction > {
164
- let d = match (
165
- self . largest_positive_change ( ) ,
166
- & self . largest_negative_change ( ) ,
167
- ) {
164
+ let d = match ( self . largest_improvement ( ) , self . largest_regression ( ) ) {
168
165
( None , None ) => return None ,
169
- ( Some ( b ) , None ) => b . direction ( ) ,
170
- ( None , Some ( b ) ) => b . direction ( ) ,
166
+ ( Some ( c ) , None ) => c . direction ( ) ,
167
+ ( None , Some ( c ) ) => c . direction ( ) ,
171
168
( Some ( a) , Some ( b) ) if a. is_increase ( ) == b. is_increase ( ) => a. direction ( ) ,
172
169
_ => Direction :: Mixed ,
173
170
} ;
@@ -186,12 +183,12 @@ impl ComparisonSummary {
186
183
changes
187
184
}
188
185
189
- pub fn largest_positive_change ( & self ) -> Option < & TestResultComparison > {
190
- self . comparisons . first ( ) . filter ( |s| s. is_increase ( ) )
186
+ pub fn largest_improvement ( & self ) -> Option < & TestResultComparison > {
187
+ self . comparisons . iter ( ) . filter ( |s| ! s. is_increase ( ) ) . next ( )
191
188
}
192
189
193
- pub fn largest_negative_change ( & self ) -> Option < & TestResultComparison > {
194
- self . comparisons . last ( ) . filter ( |s| ! s. is_increase ( ) )
190
+ pub fn largest_regression ( & self ) -> Option < & TestResultComparison > {
191
+ self . comparisons . iter ( ) . filter ( |s| s. is_increase ( ) ) . next ( )
195
192
}
196
193
197
194
pub fn confidence ( & self ) -> ComparisonConfidence {
@@ -228,7 +225,7 @@ impl ComparisonSummary {
228
225
229
226
/// The amount of confidence we have that a comparison actually represents a real
230
227
/// change in the performance characteristics.
231
- #[ derive( Clone , Copy ) ]
228
+ #[ derive( Clone , Copy , Debug ) ]
232
229
pub enum ComparisonConfidence {
233
230
MaybeRelevant ,
234
231
ProbablyRelevant ,
@@ -658,7 +655,7 @@ pub struct TestResultComparison {
658
655
impl TestResultComparison {
659
656
/// The amount of relative change considered significant when
660
657
/// the test case is not dodgy
661
- const SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD : f64 = 0.001 ;
658
+ const SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD : f64 = 0.002 ;
662
659
663
660
/// The amount of relative change considered significant when
664
661
/// the test case is dodgy
@@ -757,7 +754,7 @@ impl std::hash::Hash for TestResultComparison {
757
754
}
758
755
759
756
// The direction of a performance change
760
- #[ derive( PartialEq , Eq , Hash ) ]
757
+ #[ derive( PartialEq , Eq , Hash , Debug ) ]
761
758
pub enum Direction {
762
759
Improvement ,
763
760
Regression ,
0 commit comments