KristofferC / TimerOutputs.jl

Formatted output of timed sections in Julia
Other
659 stars 54 forks source link

Fix percentage formatting to 1 d.p. #142

Closed IanButterworth closed 2 years ago

IanButterworth commented 2 years ago

Closes #141

 ───────────────────────────────────────────────────
                         Time          Allocations  
                   ───────────────   ───────────────
  Total measured:      35.9ms            12.1MiB    

 Section   ncalls     time    %tot     alloc    %tot
 ───────────────────────────────────────────────────
 foobar         2   2.07μs   81.5%   2.94KiB  100.0%
   baz          2    150ns    5.9%     0.00B    0.0%
   foo          1    150ns    5.9%     0.00B    0.0%
   bar          1   60.0ns    2.4%     0.00B    0.0%
 foo            1    191ns    7.5%     0.00B    0.0%
 baz            2    150ns    5.9%     0.00B    0.0%
 bar            2    130ns    5.1%     0.00B    0.0%
 ───────────────────────────────────────────────────
 ────────────────────────────────────────────────────────────────────
                            Time                    Allocations      
                   ───────────────────────   ────────────────────────
 Tot / % measured:     36.2ms /   0.0%           12.1MiB /   0.0%    

 Section   ncalls     time    %tot     avg     alloc    %tot      avg
 ────────────────────────────────────────────────────────────────────
 foobar         2   2.07μs   81.5%  1.04μs   2.94KiB  100.0%  1.47KiB
   baz          2    150ns    5.9%  75.0ns     0.00B    0.0%    0.00B
   foo          1    150ns    5.9%   150ns     0.00B    0.0%    0.00B
   bar          1   60.0ns    2.4%  60.0ns     0.00B    0.0%    0.00B
 foo            1    191ns    7.5%   191ns     0.00B    0.0%    0.00B
 baz            2    150ns    5.9%  75.0ns     0.00B    0.0%    0.00B
 bar            2    130ns    5.1%  65.0ns     0.00B    0.0%    0.00B
 ────────────────────────────────────────────────────────────────────
 ─────────────────────────────────
 Section   ncalls     time    %tot
 ─────────────────────────────────
 foobar         2   2.07μs   81.5%
   baz          2    150ns    5.9%
   foo          1    150ns    5.9%
   bar          1   60.0ns    2.4%
 foo            1    191ns    7.5%
 baz            2    150ns    5.9%
 bar            2    130ns    5.1%
 ─────────────────────────────────
 ─────────────────────────────────────────
                            Time          
                   ───────────────────────
 Tot / % measured:     36.8ms /   0.0%    

 Section   ncalls     time    %tot     avg
 ─────────────────────────────────────────
 foobar         2   2.07μs   81.5%  1.04μs
   baz          2    150ns    5.9%  75.0ns
   foo          1    150ns    5.9%   150ns
   bar          1   60.0ns    2.4%  60.0ns
 foo            1    191ns    7.5%   191ns
 baz            2    150ns    5.9%  75.0ns
 bar            2    130ns    5.1%  65.0ns
 ─────────────────────────────────────────

If there are any %'s greater than 100% (which can happen in threaded merges) they will cause misalignment, but I think that's a reasonable bug to leave? (Perhaps to be fixed formally by a merge method that has a kwarg for parallelism factor that does auto division when merging, etc. but that's another issue)

codecov-commenter commented 2 years ago

Codecov Report

Merging #142 (05f122d) into master (74556e6) will decrease coverage by 0.10%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #142      +/-   ##
==========================================
- Coverage   89.26%   89.16%   -0.11%     
==========================================
  Files           5        5              
  Lines         410      406       -4     
==========================================
- Hits          366      362       -4     
  Misses         44       44              
Impacted Files Coverage Δ
src/show.jl 96.39% <100.00%> (ø)
src/utilities.jl 95.08% <100.00%> (-0.31%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 74556e6...05f122d. Read the comment docs.

IanButterworth commented 2 years ago

Just bumped the patch. It would be nice to get this out

IanButterworth commented 2 years ago

Bump. I think about this every time I see a report now 🙃