andrewrk / poop

Performance Optimizer Observation Platform
MIT License
788 stars 50 forks source link

Show progress while running commands #20

Closed mlugg closed 1 year ago

mlugg commented 1 year ago

Resolves: #8

Sample output while running:

[mlugg@polaris poop]$ ./zig-out/bin/poop 'sleep 2' 'sleep 0.3564657983425769842579824567984236947654527985'
Benchmark 1 (3 runs): sleep 2:
  measurement      mean ± σ               min … max                   outliers         delta
  wall_time        2s ± 49.11us           2s … 2s                       0 ( 0%)        0%
  peak_rss         1M ± 45K               1M … 1M                       0 ( 0%)        0%
  cpu_cycles       436236 ± 18714         414747 … 448953               0 ( 0%)        0%
  instructions     208761 ± 8             208754 … 208769               0 ( 0%)        0%
  cache_references 16577 ± 621            15934 … 17174                 0 ( 0%)        0%
  cache_misses     6299 ± 428             5877 … 6732                   0 ( 0%)        0%
  branch_misses    2882 ± 38              2840 … 2914                   0 ( 0%)        0%
poop [2/2] 'sleep 0.356465798342576984257982456798423694765...' [4/14]
andrewrk commented 1 year ago

Let me ask you a difficult question... Does this progress indicator spark joy?

dweiller commented 1 year ago

I don't know for sure, but I suspect hyperfine is using the left n/8 block unicode characters to make a (relatively) smooth progress bar:

U+2588: █
U+2589: ▉
U+258A: ▊
U+258B: ▋
U+258C: ▌
U+258D: ▌
U+258E: ▎
U+258F: ▏

They should line use to make a solid line:

████ ███▉ ███▊ ███▋ ███▌ ███▍ ███▎ ███▏

Formatting is a bit odd here (at least in my browser) but these look perfect in my terminal. I reckon these would spark joy, at least for the user.

mlugg commented 1 year ago

Let me ask you a difficult question... Does this progress indicator spark joy?

It sure does in my heart! We could use an actual progress bar if you'd like, I just personally prefer the simplicity of this.

An ETA wouldn't be overly useful (the estimated total time is normally gonna be "the timeout you gave"), and personally I always find myself looking at progress numbers rather than bars. But maybe I'm the weird one here :D

andrewrk commented 1 year ago

Alright I'm sold. But u got 32-bit compile errors

mlugg commented 1 year ago

what compile errors? :)