@@ -158,9 +158,20 @@ async fn populate_report(
158158 ( None , None ) => return ,
159159 } ;
160160
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+ } ;
162170
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+ }
164175}
165176
166177/// A summary of a given comparison
@@ -323,6 +334,14 @@ impl ComparisonSummary {
323334 . filter ( |c| c. is_regression ( ) )
324335 }
325336
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+
326345 fn largest_improvement ( & self ) -> Option < & TestResultComparison > {
327346 self . relevant_comparisons
328347 . iter ( )
@@ -1058,7 +1077,7 @@ impl std::hash::Hash for TestResultComparison {
10581077}
10591078
10601079// The direction of a performance change
1061- #[ derive( PartialEq , Eq , Hash , Debug ) ]
1080+ #[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug ) ]
10621081pub enum Direction {
10631082 Improvement ,
10641083 Regression ,
0 commit comments