@@ -472,12 +472,12 @@ async fn handle_comparison(comparison: &Comparison, report: &mut HashMap<Directi
472
472
let lo = benchmarks
473
473
. iter ( )
474
474
// 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 ( ) )
476
476
. filter ( |c| c. is_significant ( ) && !c. is_increase ( ) ) ;
477
477
let hi = benchmarks
478
478
. iter ( )
479
479
// 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 ( ) )
481
481
. filter ( |c| c. is_significant ( ) && c. is_increase ( ) ) ;
482
482
483
483
let direction = match ( lo, hi) {
@@ -497,9 +497,9 @@ async fn handle_comparison(comparison: &Comparison, report: &mut HashMap<Directi
497
497
changes. push ( lo) ;
498
498
}
499
499
changes. sort_by ( |a, b| {
500
- a . log_change ( )
500
+ b . log_change ( )
501
501
. abs ( )
502
- . partial_cmp ( & b . log_change ( ) . abs ( ) )
502
+ . partial_cmp ( & a . log_change ( ) . abs ( ) )
503
503
. unwrap_or ( std:: cmp:: Ordering :: Equal )
504
504
} ) ;
505
505
@@ -956,15 +956,15 @@ impl Comparison {
956
956
let pr = self . b . pr . unwrap ( ) ;
957
957
let title = gh_pr_title ( pr) . await ;
958
958
let mut result = format ! (
959
- "{} [#{}](https://github.com/rust-lang/rust/issues/{})" ,
959
+ "{} [#{}](https://github.com/rust-lang/rust/issues/{})\n " ,
960
960
title, pr, pr
961
961
) ;
962
962
let start = & self . a . commit ;
963
963
let end = & self . b . commit ;
964
964
let link = & compare_link ( start, end) ;
965
965
966
966
for change in changes {
967
- write ! ( result, "\n - " ) . unwrap ( ) ;
967
+ write ! ( result, "- " ) . unwrap ( ) ;
968
968
change. summary_line ( & mut result, link)
969
969
}
970
970
result
@@ -1057,7 +1057,7 @@ const SIGNIFICANCE_THRESHOLD: f64 = 0.01;
1057
1057
impl BenchmarkComparison < ' _ > {
1058
1058
fn log_change ( & self ) -> f64 {
1059
1059
let ( a, b) = self . results ;
1060
- ( a / b ) . ln ( )
1060
+ ( b / a ) . ln ( )
1061
1061
}
1062
1062
1063
1063
fn is_increase ( & self ) -> bool {
@@ -1105,7 +1105,7 @@ impl BenchmarkComparison<'_> {
1105
1105
} ;
1106
1106
1107
1107
let percent = self . relative_change ( ) * 100.0 ;
1108
- writeln ! (
1108
+ write ! (
1109
1109
summary,
1110
1110
"{} {} in [instruction counts]({})" ,
1111
1111
size,
@@ -1115,7 +1115,7 @@ impl BenchmarkComparison<'_> {
1115
1115
. unwrap ( ) ;
1116
1116
writeln ! (
1117
1117
summary,
1118
- " (up to {}% on `{}` builds of {} )" ,
1118
+ " (up to {:.1 }% on `{}` builds of `{}` )" ,
1119
1119
percent, self . cache_state, self . bench_name
1120
1120
)
1121
1121
. unwrap ( ) ;
0 commit comments