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

Port brew help (without arguments) to Bash #17710

Merged
merged 1 commit into from
Jul 14, 2024
Merged

Port brew help (without arguments) to Bash #17710

merged 1 commit into from
Jul 14, 2024

Conversation

MikeMcQuaid
Copy link
Member

@MikeMcQuaid MikeMcQuaid commented Jul 13, 2024

This provides a decent speedup:

$ hyperfine 'git checkout master; brew help' 'git checkout help_bash; brew help'
Benchmark 1: git checkout master; brew help
  Time (mean ± σ):     506.4 ms ±  50.9 ms    [User: 223.7 ms, System: 99.9 ms]
  Range (min … max):   454.6 ms … 634.1 ms    10 runs

Benchmark 2: git checkout help_bash; brew help
  Time (mean ± σ):     109.5 ms ±  57.1 ms    [User: 1

and compares favourably to pip3 help:

$ hyperfine 'brew help' 'pip3 help'
Benchmark 1: brew help
  Time (mean ± σ):      72.9 ms ±  15.9 ms    [User: 4.9 ms, System: 6.3 ms]
  Range (min … max):    53.6 ms … 126.6 ms    31 runs

Benchmark 2: pip3 help
  Time (mean ± σ):     171.5 ms ±   6.1 ms    [User: 131.6 ms, System: 24.7 ms]
  Range (min … max):   164.2 ms … 189.3 ms    15 runs

Summary
  brew help ran
    2.35 ± 0.52 times faster than pip3 help

This provides a decent speedup:
```
$ hyperfine 'git checkout master; brew help' 'git checkout help_bash; brew help'
Benchmark 1: git checkout master; brew help
  Time (mean ± σ):     506.4 ms ±  50.9 ms    [User: 223.7 ms, System: 99.9 ms]
  Range (min … max):   454.6 ms … 634.1 ms    10 runs

Benchmark 2: git checkout help_bash; brew help
  Time (mean ± σ):     109.5 ms ±  57.1 ms    [User: 1
```

and compares favourably to `pip3 help`:
```
$ hyperfine 'brew help' 'pip3 help'
Benchmark 1: brew help
  Time (mean ± σ):      72.9 ms ±  15.9 ms    [User: 4.9 ms, System: 6.3 ms]
  Range (min … max):    53.6 ms … 126.6 ms    31 runs

Benchmark 2: pip3 help
  Time (mean ± σ):     171.5 ms ±   6.1 ms    [User: 131.6 ms, System: 24.7 ms]
  Range (min … max):   164.2 ms … 189.3 ms    15 runs

Summary
  brew help ran
    2.35 ± 0.52 times faster than pip3 help
```
@MikeMcQuaid MikeMcQuaid merged commit a0ebf85 into master Jul 14, 2024
25 checks passed
@MikeMcQuaid MikeMcQuaid deleted the help_bash branch July 14, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants