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

Do not use an intermediate shell by default #787

Open
sharkdp opened this issue Dec 28, 2024 · 0 comments
Open

Do not use an intermediate shell by default #787

sharkdp opened this issue Dec 28, 2024 · 0 comments
Labels
feature-request help wanted Extra attention is needed
Milestone

Comments

@sharkdp
Copy link
Owner

sharkdp commented Dec 28, 2024

I'm opening this ticket to discuss a potential change in Hyperfine's default behavior. For now, we always use an intermediate shell to run benchmarked programs. This allows users to make use of the full shell syntax. For example, you can run things like hyperfine ~/programs/abc or hyperfine "abc && def" that wouldn't be possible without a shell. The shell-spawn time is automatically subtracted by Hyperfine. But it still adds noise to the benchmark.

The potential new default would be --shell=none which can already be used today.

This would have several advantages:

  • There is no additional noise in the measurement from launching the shell.
  • We run the program directly. All performance metrics/counters directly apply to the benchmarked program. We do not have to perform any calibration or subtraction to account for the intermediate shell.
  • Not having to perform calibration saves some time (~100 ms)

Disadvantages are:

  • you need to do things like write /home/shark/ instead of ~, expand environment variables yourself, etc. Or use --shell=… when needed. Note that quoting is supported in no-shell mode though. So command "long argument" works fine.
  • This might be potentially confusing to users who expect shell syntax to be available (all Hyperfine 1.0 users). If we simply fail, that's probably okay. But there might be cases where it's harder to debug what's going on (~ passed to the program unexpanded).
@sharkdp sharkdp added this to the hyperfine 2.0 milestone Dec 28, 2024
@sharkdp sharkdp added the help wanted Extra attention is needed label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant