Skip to content
New issue

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

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

Already on GitHub? # to your account

Port brew --repository to Bash #17726

Merged
merged 1 commit into from
Jul 14, 2024
Merged

Port brew --repository to Bash #17726

merged 1 commit into from
Jul 14, 2024

Conversation

ZhongRuoyu
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

This provides a significant speedup:

$ hyperfine 'git checkout master; brew --repo homebrew/core' 'git checkout brew-repository-speedup; brew --repo homebrew/core'
Benchmark 1: git checkout master; brew --repo homebrew/core
  Time (mean ± σ):      1.737 s ±  0.388 s    [User: 0.743 s, System: 0.323 s]
  Range (min … max):    1.336 s …  2.438 s    10 runs

Benchmark 2: git checkout brew-repository-speedup; brew --repo homebrew/core
  Time (mean ± σ):     459.1 ms ±  91.9 ms    [User: 100.5 ms, System: 142.1 ms]
  Range (min … max):   366.5 ms … 594.0 ms    10 runs

Summary
  git checkout brew-repository-speedup; brew --repo homebrew/core ran
    3.78 ± 1.13 times faster than git checkout master; brew --repo homebrew/core

This provides a significant speedup:

    $ hyperfine 'git checkout master; brew --repo homebrew/core' 'git checkout brew-repository-speedup; brew --repo homebrew/core'
    Benchmark 1: git checkout master; brew --repo homebrew/core
      Time (mean ± σ):      1.737 s ±  0.388 s    [User: 0.743 s, System: 0.323 s]
      Range (min … max):    1.336 s …  2.438 s    10 runs

    Benchmark 2: git checkout brew-repository-speedup; brew --repo homebrew/core
      Time (mean ± σ):     459.1 ms ±  91.9 ms    [User: 100.5 ms, System: 142.1 ms]
      Range (min … max):   366.5 ms … 594.0 ms    10 runs

    Summary
      git checkout brew-repository-speedup; brew --repo homebrew/core ran
        3.78 ± 1.13 times faster than git checkout master; brew --repo homebrew/core
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nice work @ZhongRuoyu!

@MikeMcQuaid MikeMcQuaid merged commit 2d26c89 into master Jul 14, 2024
24 checks passed
@MikeMcQuaid MikeMcQuaid deleted the brew-repository-speedup branch July 14, 2024 16:57
@olga-mcbfe
Copy link

brew --repo homebrew/homebrew used to return /opt/homebrew/Library/Taps/homebrew/homebrew-core and now it returns /opt/homebrew/Library/Taps/homebrew/homebrew-homebrew

@MikeMcQuaid
Copy link
Member

@olga-mcbfe The latter seems more correct to me.

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

Successfully merging this pull request may close these issues.

3 participants