Skip to content

Commit 94f0f7f

Browse files
committed
Fix last remaining differences
1 parent e2ba5c8 commit 94f0f7f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

site/src/server.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -472,12 +472,12 @@ async fn handle_comparison(comparison: &Comparison, report: &mut HashMap<Directi
472472
let lo = benchmarks
473473
.iter()
474474
// TODO: what to do when partial_cmp returns `None`?
475-
.min_by(|b1, b2| b2.log_change().partial_cmp(&b1.log_change()).unwrap())
475+
.min_by(|b1, b2| b1.log_change().partial_cmp(&b2.log_change()).unwrap())
476476
.filter(|c| c.is_significant() && !c.is_increase());
477477
let hi = benchmarks
478478
.iter()
479479
// TODO: what to do when partial_cmp returns `None`?
480-
.max_by(|b1, b2| b2.log_change().partial_cmp(&b1.log_change()).unwrap())
480+
.max_by(|b1, b2| b1.log_change().partial_cmp(&b2.log_change()).unwrap())
481481
.filter(|c| c.is_significant() && c.is_increase());
482482

483483
let direction = match (lo, hi) {
@@ -497,9 +497,9 @@ async fn handle_comparison(comparison: &Comparison, report: &mut HashMap<Directi
497497
changes.push(lo);
498498
}
499499
changes.sort_by(|a, b| {
500-
a.log_change()
500+
b.log_change()
501501
.abs()
502-
.partial_cmp(&b.log_change().abs())
502+
.partial_cmp(&a.log_change().abs())
503503
.unwrap_or(std::cmp::Ordering::Equal)
504504
});
505505

@@ -956,15 +956,15 @@ impl Comparison {
956956
let pr = self.b.pr.unwrap();
957957
let title = gh_pr_title(pr).await;
958958
let mut result = format!(
959-
"{} [#{}](https://github.com/rust-lang/rust/issues/{})",
959+
"{} [#{}](https://github.com/rust-lang/rust/issues/{})\n",
960960
title, pr, pr
961961
);
962962
let start = &self.a.commit;
963963
let end = &self.b.commit;
964964
let link = &compare_link(start, end);
965965

966966
for change in changes {
967-
write!(result, "\n- ").unwrap();
967+
write!(result, "- ").unwrap();
968968
change.summary_line(&mut result, link)
969969
}
970970
result
@@ -1057,7 +1057,7 @@ const SIGNIFICANCE_THRESHOLD: f64 = 0.01;
10571057
impl BenchmarkComparison<'_> {
10581058
fn log_change(&self) -> f64 {
10591059
let (a, b) = self.results;
1060-
(a / b).ln()
1060+
(b / a).ln()
10611061
}
10621062

10631063
fn is_increase(&self) -> bool {
@@ -1105,7 +1105,7 @@ impl BenchmarkComparison<'_> {
11051105
};
11061106

11071107
let percent = self.relative_change() * 100.0;
1108-
writeln!(
1108+
write!(
11091109
summary,
11101110
"{} {} in [instruction counts]({})",
11111111
size,
@@ -1115,7 +1115,7 @@ impl BenchmarkComparison<'_> {
11151115
.unwrap();
11161116
writeln!(
11171117
summary,
1118-
" (up to {}% on `{}` builds of {})",
1118+
" (up to {:.1}% on `{}` builds of `{}`)",
11191119
percent, self.cache_state, self.bench_name
11201120
)
11211121
.unwrap();

0 commit comments

Comments
 (0)