Skip to content
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

Allow creating triage report for arbitrary metric #1787

Merged
merged 1 commit into from
Dec 26, 2023
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
3 changes: 3 additions & 0 deletions site/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ pub mod github {
}

pub mod triage {
use crate::comparison::Metric;
use collector::Bound;
use serde::{Deserialize, Serialize};

Expand All @@ -577,6 +578,8 @@ pub mod triage {
pub start: Bound,
#[serde(default)]
pub end: Bound,
#[serde(default)]
pub metric: Option<Metric>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down
14 changes: 11 additions & 3 deletions site/src/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub async fn handle_triage(
let mut before = start.clone();

let mut num_comparisons = 0;
let metric = Metric::InstructionsUser;
let metric = body.metric.unwrap_or(Metric::InstructionsUser);
let benchmark_map = ctxt.get_benchmark_category_map().await;

let end = loop {
Expand All @@ -85,7 +85,7 @@ pub async fn handle_triage(
);

// handle results of comparison
populate_report(&comparison, &benchmark_map, &mut report).await;
populate_report(&comparison, &benchmark_map, metric, &mut report).await;

// If we already know this is the last iteration, we can stop
if comparison.b.artifact == end_artifact {
Expand Down Expand Up @@ -207,6 +207,7 @@ pub async fn handle_compare(
async fn populate_report(
comparison: &ArtifactComparison,
benchmark_map: &HashMap<Benchmark, Category>,
metric: Metric,
report: &mut HashMap<Direction, Vec<String>>,
) {
let (primary, secondary) = comparison
Expand All @@ -218,7 +219,14 @@ async fn populate_report(
return;
}

let include_in_triage = deserves_attention_icount(&primary, &secondary);
let include_in_triage = match metric {
Metric::InstructionsUser => deserves_attention_icount(&primary, &secondary),
_ => primary
.largest_change()
.or_else(|| secondary.largest_change())
.map(|c| c.magnitude() >= Magnitude::Small)
.unwrap_or(false),
};

if include_in_triage {
let entry = report.entry(direction).or_default();
Expand Down
5 changes: 5 additions & 0 deletions triage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ Use the API endpoint to automate building the file:
% curl "https://perf.rust-lang.org/perf/triage?start=$PARENT" > YYYY-MM-DD.md
```

You can also analyze binary size regressions/improvements using the following command:
```
% curl "https://perf.rust-lang.org/perf/triage?start=$PARENT&metric=size:linked-artifact" > binary-size.md
```

## Analysis

The following is a list of items you should look for when interpreting performance results.
Expand Down