Skip to content

Commit aaf6433

Browse files
Merge pull request #1008 from Mark-Simulacrum/docs
Update documentation for changes to significance
2 parents fb335b3 + f924c11 commit aaf6433

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

docs/comparison-analysis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ A test result is significant if the relative change percentage is considered an
4141

4242
```
4343
interquartile_range = Q3 - Q1
44-
result > Q3 + (interquartile_range * 1.5)
44+
result > Q3 + (interquartile_range * 3)
4545
```
4646

4747
(Assuming the data is ordered, Q3 is the median of the upper half of the data while Q1 is the median of the lower half.)

site/src/comparison.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -673,15 +673,15 @@ impl BenchmarkVariance {
673673
// |
674674
// ---- -significance_threshold()
675675
fn significance_threshold(&self) -> f64 {
676-
let (q1, median, q3) = self.quartiles();
676+
let (q1, q3) = self.quartiles();
677677

678-
// Changes that are IQR_MULTIPLIER away from the median are considered
679-
// significant (i.e. outliers).
680-
median + (q3 - q1) * Self::IQR_MULTIPLIER
678+
// Changes that are IQR_MULTIPLIER away from the Q3 are considered
679+
// outliers, and we judge those as significant.
680+
q3 + (q3 - q1) * Self::IQR_MULTIPLIER
681681
}
682682

683-
// (q1, q2=median, q3)
684-
fn quartiles(&self) -> (f64, f64, f64) {
683+
// (q1, q3)
684+
fn quartiles(&self) -> (f64, f64) {
685685
let pcs = self.percent_changes();
686686
fn median(data: &[f64]) -> f64 {
687687
if data.len() % 2 == 0 {
@@ -698,10 +698,9 @@ impl BenchmarkVariance {
698698
(len / 2 - 1, len / 2 + 1)
699699
};
700700
let q1 = median(&pcs[..=h1_end]);
701-
let q2 = median(&pcs[..]);
702701
let q3 = median(&pcs[h2_begin..]);
703702

704-
(q1, q2, q3)
703+
(q1, q3)
705704
}
706705

707706
fn calculate_description(&mut self) {

0 commit comments

Comments
 (0)