-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Speed up brew list
#17317
Merged
Merged
Speed up brew list
#17317
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
carlocab
reviewed
May 16, 2024
MikeMcQuaid
force-pushed
the
list_speedup
branch
2 times, most recently
from
May 16, 2024 14:43
499be85
to
74a9ab9
Compare
carlocab
reviewed
May 16, 2024
carlocab
approved these changes
May 16, 2024
MikeMcQuaid
force-pushed
the
list_speedup
branch
2 times, most recently
from
May 16, 2024 15:18
1ee5925
to
adb00ff
Compare
MikeMcQuaid
force-pushed
the
list_speedup
branch
2 times, most recently
from
May 17, 2024 03:30
3ce3009
to
475d558
Compare
carlocab
reviewed
May 17, 2024
Similarly to have we have with other commands, use Bash to speed it up. Before: ``` $ hyperfine "brew list" Benchmark 1: brew list Time (mean ± σ): 559.9 ms ± 122.8 ms [User: 176.2 ms, System: 126.2 ms] Range (min … max): 503.2 ms … 907.3 ms 10 runs ``` After: ``` $ hyperfine "brew list" Benchmark 1: brew list Time (mean ± σ): 223.7 ms ± 31.9 ms [User: 35.0 ms, System: 53.4 ms] Range (min … max): 198.1 ms … 302.4 ms 10 ``` Petty after comparison because someone on Homebrew/discussions compared them: ``` $ hyperfine "brew list" "pip3 list" Benchmark 1: brew list Time (mean ± σ): 213.1 ms ± 22.8 ms [User: 34.2 ms, System: 49.2 ms] Range (min … max): 191.2 ms … 272.3 ms 13 runs Benchmark 2: pip3 list Time (mean ± σ): 271.7 ms ± 4.6 ms [User: 191.9 ms, System: 40.0 ms] Range (min … max): 264.7 ms … 281.4 ms 10 runs Summary brew list ran 1.28 ± 0.14 times faster than pip3 list ``` --- While we're here, also add the `HOMEBREW_CASKROOM` environment variable to make things a bit cleaner and use `--caskroom` in documentation. Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
Thanks for the help @carlocab! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Similarly to have we have with other commands, use Bash to speed it up.
Before:
After:
Petty after comparison because someone on Homebrew/discussions compared them:
While we're here, also add the
HOMEBREW_CASKROOM
environment variable to make things a bit cleaner and use--caskroom
in documentation.