Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compact output format, finer control over the output #70

Closed
lucc opened this issue Jul 27, 2018 · 6 comments
Closed

Compact output format, finer control over the output #70

lucc opened this issue Jul 27, 2018 · 6 comments
Labels

Comments

@lucc
Copy link

lucc commented Jul 27, 2018

I am running hyperfine with many different commands at once. In order to not only see the factor between the different commands at the end but also (some) of the means I suggest one, some or all of these changes to the output (switchable by a command line option):

  • Do not print empty lines between mean and min-max and the headlines and so on. I can currently get quite close to what I want when I run hyperfine ... | sed '/^ *$/d'.
  • The above mentioned hyperfine ... | sed '/^ *$/d' is without color and when I run hyperfine -s full ... | sed '/^ *$/d' instead I also get the interactive graph which doesn't play nicely with the pipe and sometimes messes up a line. So why not add a color style to -s which has color but is not interactive?
  • All of these could be an additional value for -s and -s could be a comma separated list so that things like this would make sense: hyperfine -s compact,color, hyperfine -s interactive,compact,nocolor, hyperfine -s full,compact, hyperfne -s basic,compact...
@sharkdp
Copy link
Owner

sharkdp commented Jul 30, 2018

Thank you for the feedback!

Do not print empty lines between mean and min-max and the headlines and so on. I can currently get quite close to what I want when I run hyperfine ... | sed '/^ *$/d'.

I agree, we could save up some vertical space here. What do you think of the following compromise: skip all blank lines, except between two benchmarks:

Benchmark #1: sleep 0.1
  Time (mean ± σ):     101.1 ms ±   0.1 ms    [User: 0.7 ms, System: 1.2 ms]
  Range (min … max):   100.5 ms … 101.3 ms

Benchmark #2: sleep 0.01
  Time (mean ± σ):      11.1 ms ±   0.1 ms    [User: 0.9 ms, System: 0.6 ms]
  Range (min … max):    10.8 ms …  11.4 ms

Benchmark #3: sleep 0.11
  Time (mean ± σ):     111.2 ms ±   0.1 ms    [User: 1.1 ms, System: 0.4 ms]
  Range (min … max):   111.1 ms … 111.3 ms

Summary
  'sleep 0.01' ran
    9.09x faster than 'sleep 0.1'
    9.99x faster than 'sleep 0.11'

The above mentioned hyperfine ... | sed '/^ *$/d' is without color and when I run hyperfine -s full ... | sed '/^ *$/d' instead I also get the interactive graph which doesn't play nicely with the pipe and sometimes messes up a line. So why not add a color style to -s which has color but is not interactive?

Sounds good to me!

All of these could be an additional value for -s and -s could be a comma separated list so that things like this would make sense: hyperfine -s compact,color, hyperfine -s interactive,compact,nocolor, hyperfine -s full,compact, hyperfne -s basic,compact...

If we would strip some blank lines by default, as suggested above, do you think we would still need a compact option?

@lucc
Copy link
Author

lucc commented Jul 30, 2018

I am fine with making the semi compact output that you defined the default. My suggestion for the "compact" keyword was only for backwards compatibility.

@sharkdp
Copy link
Owner

sharkdp commented Jul 30, 2018

Ok, so let's:

  • Strip the empty lines
  • Add color as new type for --style.

@jasonpeacock
Copy link
Contributor

Working on this...

@jasonpeacock
Copy link
Contributor

PR submitted.

@sharkdp
Copy link
Owner

sharkdp commented Sep 28, 2018

Released in v1.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants