@@ -113,7 +113,7 @@ fn (a Aints) str() string {
113
113
baseline := '${avg} ± σ: ${tdev} ,'
114
114
tmin := term.colorize (term.bright_cyan, '${f64(a.imin) / 1000:5.1f} ms' )
115
115
tmax := term.colorize (term.bright_blue, '${f64(a.imax) / 1000:5.1f} ms' )
116
- return '${baseline:-46s} ${tmin} … ${tmax} '
116
+ return '${baseline:-46s} ${tmin} … ${tmax} '
117
117
}
118
118
119
119
fn flushed_print (s string ) {
@@ -288,22 +288,31 @@ fn (mut context Context) show_diff_summary() {
288
288
mut first_cmd_percentage := f64 (100.0 )
289
289
mut first_marker := ''
290
290
if context.results.len == 1 {
291
- context.show_summary_title ('${term.colorize(term.yellow, context.results[0].cmd):-57s} \n ${context.results[0].atiming} , ${context.series} series, ${context.run_count} runs' )
291
+ context.show_summary_title ('${context.results[0].atiming} , ${context.series} series, ${context.run_count} runs for ${term.colorize(term.green,
292
+ context.results[0].cmd):-57s}' )
292
293
} else {
293
- context.show_summary_title ('Summary after ${context.series} series x ${context.run_count} runs (`>` is the first cmd) ' )
294
+ context.show_summary_title ('Summary after ${context.series} series x ${context.run_count} runs (%s are relative to first command, or `base`). ' )
294
295
for i, r in context.results {
295
296
first_marker = ' '
296
297
cpercent := (r.atiming.average / base) * 100 - 100
297
298
if r.icmd == 0 {
298
299
first_marker = bold ('>' )
299
300
first_cmd_percentage = cpercent
300
301
}
301
- mut comparison := '=== '
302
+ mut comparison := ''
302
303
if r.atiming.average != base {
303
- comparison = '${cpercent:+7 .1f} %'
304
+ comparison = '${cpercent:+6 .1f} %'
304
305
}
305
- println (' ${first_marker}${(i + 1):3} ${comparison:9} `${r.cmd} `' )
306
- println (' ${r.atiming} ' )
306
+ mut tcomparison := 'base '
307
+ if r.atiming.average != base {
308
+ if r.atiming.average < base {
309
+ tcomparison = '${base / r.atiming.average:4.2f} x faster'
310
+ } else {
311
+ tcomparison = '${r.atiming.average / base:4.2f} x slower'
312
+ }
313
+ }
314
+ println (' ${first_marker}${(i + 1):3} ${comparison:7} ${tcomparison:5} ${r.atiming} `${term.colorize(term.green,
315
+ r.cmd)}`' )
307
316
}
308
317
}
309
318
$if debugcontext ? {
0 commit comments