Skip to content

Commit 04fccd8

Browse files
authored
Merge pull request #1277 from rylev/relevance-filter
Change the 'significance' filter on the comparison page to a 'relevance' filter
2 parents bf4aacc + a13d12c commit 04fccd8

File tree

3 files changed

+15
-44
lines changed

3 files changed

+15
-44
lines changed

site/src/api.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,8 @@ pub mod comparison {
189189
pub benchmark: String,
190190
pub profile: String,
191191
pub scenario: String,
192-
pub is_significant: bool,
192+
pub is_relevant: bool,
193193
pub significance_factor: Option<f64>,
194-
pub magnitude: String,
195194
pub statistics: (f64, f64),
196195
}
197196
}

site/src/comparison.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ pub async fn handle_compare(
117117
benchmark: comparison.benchmark.to_string(),
118118
profile: comparison.profile.to_string(),
119119
scenario: comparison.scenario.to_string(),
120-
is_significant: comparison.is_significant(),
120+
is_relevant: comparison.is_relevant(),
121121
significance_factor: comparison.significance_factor(),
122-
magnitude: comparison.magnitude().display().to_owned(),
123122
statistics: comparison.results,
124123
})
125124
.collect();
@@ -1142,16 +1141,6 @@ impl Magnitude {
11421141
fn is_medium_or_above(&self) -> bool {
11431142
*self >= Self::Medium
11441143
}
1145-
1146-
pub fn display(&self) -> &'static str {
1147-
match self {
1148-
Self::VerySmall => "very small",
1149-
Self::Small => "small",
1150-
Self::Medium => "moderate",
1151-
Self::Large => "large",
1152-
Self::VeryLarge => "very large",
1153-
}
1154-
}
11551144
}
11561145

11571146
async fn generate_report(

site/static/compare.html

+13-30
Original file line numberDiff line numberDiff line change
@@ -525,29 +525,17 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
525525
</ul>
526526
</div>
527527
<div class="section">
528-
<div class="section-heading"><span>Show only significant changes</span>
528+
<div class="section-heading"><span>Show non-relevant results</span>
529529
<span class="tooltip">?
530530
<span class="tooltiptext">
531-
Whether to filter out all benchmarks that do not show significant changes. A significant
532-
change is any change greater than or equal to 0.2% for non-noisy benchmarks and above
533-
1.0% for noisy ones.
531+
Whether to show test case results that are not relevant (i.e., not significant or
532+
have a large enough magnitude). You can see
533+
<a href="https://github.com/rust-lang/rustc-perf/blob/master/docs/comparison-analysis.md#how-is-relevance-of-a-test-run-summary-determined">
534+
here</a> how relevance is calculated.
534535
</span>
535536
</span>
536537
</div>
537-
<input type="checkbox" v-model="filter.showOnlySignificant" style="margin-left: 20px;" />
538-
</div>
539-
<div class="section">
540-
<div class="section-heading"><span>Filter out very small changes</span>
541-
<span class="tooltip">?
542-
<span class="tooltiptext">
543-
Whether to filter out test cases that have a very small magnitude. Magnitude is
544-
calculated both on the absolute magnitude (i.e., how large of a percentage change)
545-
as well as the magnitude of the significance (i.e., by how many time the change was
546-
over the significance threshold).
547-
</span>
548-
</span>
549-
</div>
550-
<input type="checkbox" v-model="filter.filterVerySmall" style="margin-left: 20px;" />
538+
<input type="checkbox" v-model="filter.showNonRelevant" style="margin-left: 20px;" />
551539
</div>
552540
<div class="section">
553541
<div class="section-heading"><span>Display raw data</span>
@@ -700,8 +688,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
700688
return {
701689
filter: {
702690
name: null,
703-
showOnlySignificant: true,
704-
filterVerySmall: true,
691+
showNonRelevant: false,
705692
profile: {
706693
check: true,
707694
debug: true,
@@ -782,17 +769,14 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
782769
let nameFilter = filter.name && filter.name.trim();
783770
nameFilter = !nameFilter || name.includes(nameFilter);
784771

785-
const significanceFilter = filter.showOnlySignificant ? testCase.isSignificant : true;
786-
787-
const magnitudeFilter = filter.filterVerySmall ? testCase.magnitude != "very small" : true;
772+
const relevanceFilter = filter.showNonRelevant ? true : testCase.isRelevant;
788773

789774
return (
790775
profileFilter(testCase.profile) &&
791776
scenarioFilter(testCase.scenario) &&
792777
categoryFilter(testCase.category) &&
793-
significanceFilter &&
794-
nameFilter &&
795-
magnitudeFilter
778+
relevanceFilter &&
779+
nameFilter
796780
);
797781
}
798782

@@ -807,8 +791,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
807791
profile: c.profile,
808792
scenario: c.scenario,
809793
category: (benchmarkMap[c.benchmark] || {}).category || "secondary",
810-
magnitude: c.magnitude,
811-
isSignificant: c.is_significant,
794+
isRelevant: c.is_relevant,
812795
significanceFactor: c.significance_factor,
813796
datumA,
814797
datumB,
@@ -909,10 +892,10 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
909892
};
910893

911894
const addDatum = (result, datum, percent) => {
912-
if (percent > 0 && datum.is_significant) {
895+
if (percent > 0 && datum.is_relevant) {
913896
result.regressions += 1;
914897
result.regressions_avg += percent;
915-
} else if (percent < 0 && datum.is_significant) {
898+
} else if (percent < 0 && datum.is_relevant) {
916899
result.improvements += 1;
917900
result.improvements_avg += percent;
918901
} else {

0 commit comments

Comments
 (0)