Skip to content

Commit 25d59d6

Browse files
Merge pull request #999 from rylev/significance-threshold
Add a severity column
2 parents cd2cd93 + 69c0cd2 commit 25d59d6

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

site/src/api.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ pub mod comparison {
187187
pub profile: String,
188188
pub scenario: String,
189189
pub is_significant: bool,
190+
pub significance_threshold: f64,
190191
pub is_dodgy: bool,
191192
pub historical_statistics: Option<Vec<f64>>,
192193
pub statistics: (f64, f64),

site/src/comparison.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ pub async fn handle_compare(
114114
scenario: comparison.scenario.to_string(),
115115
is_dodgy: comparison.is_dodgy(),
116116
is_significant: comparison.is_significant(),
117+
significance_threshold: comparison.signifcance_threshold() * 100.0,
117118
historical_statistics: comparison.variance.map(|v| v.data),
118119
statistics: comparison.results,
119120
})

site/static/compare.html

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,15 @@
192192
text-align: center;
193193
}
194194

195-
#benches th {
195+
#benches tbody:first-child th {
196+
text-align: center;
197+
}
198+
199+
#benches tbody:not(:first-child) th {
196200
border-right: dotted 1px;
201+
}
202+
203+
#benches th {
197204
text-align: left;
198205
word-break: break-word;
199206
width: 25%;
@@ -401,6 +408,26 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
401408
</div>
402409
</div>
403410
<table id="benches" class="compare">
411+
<tbody>
412+
<tr>
413+
<th>Name & Profile</th>
414+
<th>Scenario</th>
415+
<th>{{before}}</th>
416+
<th>{{after}}</th>
417+
<th>% Change</th>
418+
<th>
419+
Significance Factor<span class="tooltip">?
420+
<span class="tooltiptext">
421+
How much a particular result is over the significance threshold. A factor of 2.50x
422+
means
423+
the result is 2.5 times over the significance threshold. You can see <a
424+
href="https://github.com/rust-lang/rustc-perf/blob/master/docs/comparison-analysis.md#what-makes-a-test-result-significant">
425+
here</a> how the significance threshold is calculated.
426+
</span>
427+
</span>
428+
</th>
429+
</tr>
430+
</tbody>
404431
<template v-for="bench in benches">
405432
<tbody>
406433
<template v-for="run in bench.variants">
@@ -425,6 +452,9 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
425452
</span>
426453
</a>
427454
</td>
455+
<td>
456+
{{ Math.abs(run.percent / run.significanceThreshold).toFixed(2) }}x
457+
</td>
428458
</tr>
429459
</template>
430460
</tbody>
@@ -541,6 +571,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
541571
datumB,
542572
percent,
543573
isDodgy,
574+
significanceThreshold: r.significance_threshold,
544575
isSignificant
545576
});
546577
}

0 commit comments

Comments
 (0)