Skip to content

Update documentation for changes to significance #1008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/comparison-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ A test result is significant if the relative change percentage is considered an

```
interquartile_range = Q3 - Q1
result > Q3 + (interquartile_range * 1.5)
result > Q3 + (interquartile_range * 3)
```

(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.)
Expand Down
15 changes: 7 additions & 8 deletions site/src/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,15 +673,15 @@ impl BenchmarkVariance {
// |
// ---- -significance_threshold()
fn significance_threshold(&self) -> f64 {
let (q1, median, q3) = self.quartiles();
let (q1, q3) = self.quartiles();

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

// (q1, q2=median, q3)
fn quartiles(&self) -> (f64, f64, f64) {
// (q1, q3)
fn quartiles(&self) -> (f64, f64) {
let pcs = self.percent_changes();
fn median(data: &[f64]) -> f64 {
if data.len() % 2 == 0 {
Expand All @@ -698,10 +698,9 @@ impl BenchmarkVariance {
(len / 2 - 1, len / 2 + 1)
};
let q1 = median(&pcs[..=h1_end]);
let q2 = median(&pcs[..]);
let q3 = median(&pcs[h2_begin..]);

(q1, q2, q3)
(q1, q3)
}

fn calculate_description(&mut self) {
Expand Down