@@ -362,15 +362,16 @@ function Base.show(io::IO, ::MIME"text/plain", t::Trial)
362
362
modulestr = " " # "BenchmarkTools."
363
363
avgcolor = :green
364
364
medcolor = :blue
365
+ alloccolor = :yellow
365
366
captioncolor = :light_black
366
367
showpercentile = 99 # used both for display time, and to set right cutoff of histogram
367
368
368
- allocsstr = if allocs (t) == 0
369
- " 0 allocations"
369
+ alloc_strings = if allocs (t) == 0
370
+ ( " 0 allocations" , " " )
370
371
elseif allocs (t) == 1
371
- " 1 allocation, " * prettymemory (memory (t))
372
+ ( " 1 allocation, " , prettymemory (memory (t))) # divided in two to colour the second
372
373
else
373
- prettycount (allocs (t)) * " allocations, total " * prettymemory (memory (t))
374
+ ( prettycount (allocs (t)) * " allocations, total " , prettymemory (memory (t) ))
374
375
end
375
376
376
377
samplesstr = string (
@@ -394,7 +395,9 @@ function Base.show(io::IO, ::MIME"text/plain", t::Trial)
394
395
# Memory
395
396
println (io)
396
397
printstyled (io, pad, " │" , boxspace; color= boxcolor)
397
- print (io, allocsstr)
398
+ # print(io, allocsstr)
399
+ print (io, alloc_strings[1 ])
400
+ printstyled (io, alloc_strings[2 ]; color= alloccolor)
398
401
399
402
# GC time
400
403
if t. gctimes[1 ] > 0
@@ -437,7 +440,9 @@ function Base.show(io::IO, ::MIME"text/plain", t::Trial)
437
440
println (io)
438
441
439
442
printstyled (io, pad, " │" , boxspace; color= boxcolor)
440
- println (io, allocsstr)
443
+ # println(io, allocsstr)
444
+ print (io, alloc_strings[1 ])
445
+ printstyled (io, alloc_strings[2 ] * " \n " ; color= alloccolor)
441
446
442
447
if ! all (iszero, t. gctimes)
443
448
# Mean GC time is just that; then we take the percentage of the mean time
0 commit comments