@@ -202,8 +202,8 @@ function print_test_results(ts::ReTestSet, fmt::Format;
202
202
end
203
203
if fmt. stats
204
204
# copied from Julia/test/runtests.jl
205
- Compile = VERSION >= v " 1.6-" ? " | Compile (s) " : " "
206
- printstyled (" | Time (s) $Compile | GC (s) | GC % | Alloc (MB) | ΔRSS (MB) " , color= :white )
205
+ compile_header = VERSION >= v " 1.6-" ? " Compile / " : " "
206
+ printstyled (" | Time / $compile_header GC | Alloc ΔRSS | " , color= :white )
207
207
end
208
208
println ()
209
209
end
@@ -368,38 +368,29 @@ function print_counts(ts::ReTestSet, fmt::Format, depth, align,
368
368
if fmt. stats && print_total # copied from Julia/test/runtests.jl
369
369
ts. overall && set_timed! (ts)
370
370
timed = ts. timed
371
- elapsed_align = textwidth (" Time (s)" )
372
- compile_align = textwidth (" Compile (s)" )
373
- gc_align = textwidth (" GC (s)" )
374
- percent_align = textwidth (" GC %" )
375
- alloc_align = textwidth (" Alloc (MB)" )
376
- rss_align = textwidth (" ΔRSS (MB)" )
377
371
378
372
# we don't want to report zeros, which makes it hard to spot non-zeros
379
- function hide_zero (str)
380
- len = length (str)
373
+ function hide_zero (str, unit)
381
374
strip (str, ' ' ) in (" 0.0" , " 0.00" ) ?
382
- ' ' ^ length (str) :
383
- str
375
+ ' ' ^ ( 1 + length (str)) : # +1 for unit
376
+ str * unit
384
377
end
385
378
386
- time_str = hide_zero (@sprintf (" %7 .2f" , timed. time))
387
- printstyled (" | " , lpad ( time_str, elapsed_align, " " ), " | " , color= :white )
379
+ time_str = hide_zero (@sprintf (" %6 .2f" , timed. time), " s " )
380
+ printstyled (" | " , time_str, " " , color= :white )
388
381
if VERSION >= v " 1.6-"
389
- compile_str = hide_zero (@sprintf (" %7.2f" , timed. compile_time / 10 ^ 9 ))
390
- printstyled (lpad (compile_str, compile_align, " " ), " | " , color= :white )
382
+ compile_str = hide_zero (@sprintf (" %5.1f" , timed. compile_time / 10 ^ 7 / timed. time), " %" )
383
+ # can be >= 100% !?
384
+ printstyled (compile_str, " " , color= :white )
391
385
end
392
- gc_str = hide_zero (@sprintf (" %5.2f" , timed. gctime))
393
- printstyled (lpad (gc_str, gc_align, " " ), " | " , color= :white )
394
-
395
- # since there may be quite a few digits in the percentage,
396
- # the left-padding here is less to make sure everything fits
397
- percent_str = hide_zero (@sprintf (" %4.1f" , 100 * timed. gctime / timed. time))
398
- printstyled (lpad (percent_str, percent_align, " " ), " | " , color= :white )
399
- alloc_str = hide_zero (@sprintf (" %5.2f" , timed. bytes / 2 ^ 20 ))
400
- printstyled (lpad (alloc_str, alloc_align, " " ), " | " , color= :white )
401
- rss_str = hide_zero (@sprintf (" %5.2f" , timed. rss / 2 ^ 20 ))
402
- printstyled (lpad (rss_str, rss_align, " " ), color= :white )
386
+ gc_str = hide_zero (@sprintf (" %4.1f" , 100 * timed. gctime / timed. time), " %" )
387
+ printstyled (gc_str, " | " , color= :white )
388
+
389
+ alloc_str = hide_zero (@sprintf (" %6.1f" , timed. bytes / 2 ^ 20 ), " M" )
390
+ printstyled (alloc_str, " " , color= :white )
391
+
392
+ rss_str = hide_zero (@sprintf (" %5.1f" , timed. rss / 2 ^ 20 ), " M" )
393
+ printstyled (rss_str, " |" , color= :white )
403
394
end
404
395
println ()
405
396
0 commit comments