Skip to content

Commit 5d0d640

Browse files
committed
Change the 'significance' filter on the comparison page to a relevance filter
1 parent 55dbcb9 commit 5d0d640

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,10 +189,9 @@ 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>,
194194
pub is_dodgy: bool,
195-
pub magnitude: String,
196195
pub statistics: (f64, f64),
197196
}
198197
}

site/src/comparison.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,8 @@ pub async fn handle_compare(
118118
profile: comparison.profile.to_string(),
119119
scenario: comparison.scenario.to_string(),
120120
is_dodgy: comparison.is_dodgy(),
121-
is_significant: comparison.is_significant(),
121+
is_relevant: comparison.is_relevant(),
122122
significance_factor: comparison.significance_factor(),
123-
magnitude: comparison.magnitude().display().to_owned(),
124123
statistics: comparison.results,
125124
})
126125
.collect();
@@ -1164,16 +1163,6 @@ impl Magnitude {
11641163
fn is_medium_or_above(&self) -> bool {
11651164
*self >= Self::Medium
11661165
}
1167-
1168-
pub fn display(&self) -> &'static str {
1169-
match self {
1170-
Self::VerySmall => "very small",
1171-
Self::Small => "small",
1172-
Self::Medium => "moderate",
1173-
Self::Large => "large",
1174-
Self::VeryLarge => "very large",
1175-
}
1176-
}
11771166
}
11781167

11791168
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
isDodgy: c.is_dodgy,
814797
datumA,
@@ -910,10 +893,10 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
910893
};
911894

912895
const addDatum = (result, datum, percent) => {
913-
if (percent > 0 && datum.is_significant) {
896+
if (percent > 0 && datum.is_relevant) {
914897
result.regressions += 1;
915898
result.regressions_avg += percent;
916-
} else if (percent < 0 && datum.is_significant) {
899+
} else if (percent < 0 && datum.is_relevant) {
917900
result.improvements += 1;
918901
result.improvements_avg += percent;
919902
} else {

0 commit comments

Comments
 (0)