@@ -158,9 +158,20 @@ async fn populate_report(
158
158
( None , None ) => return ,
159
159
} ;
160
160
161
- let entry = report. entry ( direction) . or_default ( ) ;
161
+ let include_in_triage = match ( primary. largest_change ( ) , secondary. largest_change ( ) ) {
162
+ ( Some ( c) , _) if c. magnitude ( ) >= Magnitude :: Medium => true ,
163
+ ( _, Some ( c) ) if c. magnitude ( ) >= Magnitude :: Medium => true ,
164
+ _ => {
165
+ let primary_n = primary. num_changes ( ) ;
166
+ let secondary_n = secondary. num_changes ( ) ;
167
+ ( primary_n * 2 + secondary_n) >= 6
168
+ }
169
+ } ;
162
170
163
- entry. push ( write_triage_summary ( comparison, & primary, & secondary) . await )
171
+ if include_in_triage {
172
+ let entry = report. entry ( direction) . or_default ( ) ;
173
+ entry. push ( write_triage_summary ( comparison, & primary, & secondary) . await ) ;
174
+ }
164
175
}
165
176
166
177
/// A summary of a given comparison
@@ -323,6 +334,14 @@ impl ComparisonSummary {
323
334
. filter ( |c| c. is_regression ( ) )
324
335
}
325
336
337
+ fn num_changes ( & self ) -> usize {
338
+ self . relevant_comparisons . len ( )
339
+ }
340
+
341
+ fn largest_change ( & self ) -> Option < & TestResultComparison > {
342
+ self . relevant_comparisons . first ( )
343
+ }
344
+
326
345
fn largest_improvement ( & self ) -> Option < & TestResultComparison > {
327
346
self . relevant_comparisons
328
347
. iter ( )
@@ -1058,7 +1077,7 @@ impl std::hash::Hash for TestResultComparison {
1058
1077
}
1059
1078
1060
1079
// The direction of a performance change
1061
- #[ derive( PartialEq , Eq , Hash , Debug ) ]
1080
+ #[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug ) ]
1062
1081
pub enum Direction {
1063
1082
Improvement ,
1064
1083
Regression ,
0 commit comments