Skip to content

Commit 05479f3

Browse files
committed
tools: improve alignment for v repeat "program" "program_that_is_over_10x_faster"
1 parent 267d826 commit 05479f3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cmd/tools/vrepeat.v

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ fn bold(s string) string {
135135
}
136136

137137
fn (a Aints) str() string {
138-
avg := bold('${a.average / 1000:5.1f}ms')
139-
tdev := c(tred, '${a.stddev / 1000:5.1f}ms')
138+
avg := bold('${a.average / 1000:6.1f}ms')
139+
tdev := c(tred, '${a.stddev / 1000:6.1f}ms')
140140
baseline := '${avg} ± σ: ${tdev},'
141-
tmin := c(tbcyan, '${f64(a.imin) / 1000:5.1f}ms')
142-
tmax := c(tbblue, '${f64(a.imax) / 1000:5.1f}ms')
141+
tmin := c(tbcyan, '${f64(a.imin) / 1000:6.1f}ms')
142+
tmax := c(tbblue, '${f64(a.imax) / 1000:6.1f}ms')
143143
return '${baseline:-46s} ${tmin}${tmax}'
144144
}
145145

@@ -345,9 +345,9 @@ fn (mut context Context) show_diff_summary() {
345345
}
346346
mut comparison := ''
347347
if r.atiming.average != base {
348-
comparison = '${cpercent:+6.1f}%'
348+
comparison = '${cpercent:+8.1f}%'
349349
}
350-
mut tcomparison := 'base '
350+
mut tcomparison := ' base '
351351
if r.atiming.average != base {
352352
tcomparison = readable_comparison(r.atiming.average, base, cpercent)
353353
}
@@ -381,12 +381,12 @@ fn readable_comparison(tcurrent f64, tbase f64, cpercent f64) string {
381381
if !is_same {
382382
label = c(tgreen, 'faster')
383383
}
384-
return '${tbase / tcurrent:4.2f}x ${label}'
384+
return '${tbase / tcurrent:6.2f}x ${label}'
385385
} else {
386386
if !is_same {
387387
label = c(tcyan, 'slower')
388388
}
389-
return '${tcurrent / tbase:4.2f}x ${label}'
389+
return '${tcurrent / tbase:6.2f}x ${label}'
390390
}
391391
}
392392

0 commit comments

Comments
 (0)