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

Simplify globbing for casks and formula in taps #18176

Merged

Conversation

apainintheneck
Copy link
Contributor

  • 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?

TLDR: @Bo98 was right in #18165 (comment).

This is yet another approach to f3a5a3c which got merged in over the weekend. It is much simpler than what we've got now with almost exactly the same performance characteristics. A better combination of maintainability and performance.

$ hyperfine --parameter-list branch master,speed-up-loading-cask-and-formula-file-names_v4 --warmup 5 --setup 'git switch {branch}' 'brew cat gimp'
Benchmark 1: brew cat gimp (branch = master)
  Time (mean ± σ):      1.459 s ±  0.012 s    [User: 0.892 s, System: 0.536 s]
  Range (min … max):    1.448 s …  1.483 s    10 runs

Benchmark 2: brew cat gimp (branch = speed-up-loading-cask-and-formula-file-names_v4)
  Time (mean ± σ):      1.456 s ±  0.009 s    [User: 0.889 s, System: 0.536 s]
  Range (min … max):    1.445 s …  1.468 s    10 runs

Summary
  brew cat gimp (branch = speed-up-loading-cask-and-formula-file-names_v4) ran
    1.00 ± 0.01 times faster than brew cat gimp (branch = master)

This is yet another approach to f3a5a3c
which got merged in over the weekend. It is much simpler than what we've
got now with almost exactly the same performance characteristics. A great
combination of maintability and performance.

```console
$ hyperfine --parameter-list branch master,speed-up-loading-cask-and-formula-file-names_v4 --warmup 5 --setup 'git switch {branch}' 'brew cat gimp'
Benchmark 1: brew cat gimp (branch = master)
  Time (mean ± σ):      1.459 s ±  0.012 s    [User: 0.892 s, System: 0.536 s]
  Range (min … max):    1.448 s …  1.483 s    10 runs

Benchmark 2: brew cat gimp (branch = speed-up-loading-cask-and-formula-file-names_v4)
  Time (mean ± σ):      1.456 s ±  0.009 s    [User: 0.889 s, System: 0.536 s]
  Range (min … max):    1.445 s …  1.468 s    10 runs

Summary
  brew cat gimp (branch = speed-up-loading-cask-and-formula-file-names_v4) ran
    1.00 ± 0.01 times faster than brew cat gimp (branch = master)
```
@apainintheneck apainintheneck merged commit f31aa91 into master Aug 27, 2024
27 checks passed
@apainintheneck apainintheneck deleted the speed-up-loading-cask-and-formula-file-names_v4 branch August 27, 2024 08:03
@MikeMcQuaid
Copy link
Member

Much nicer, thanks!

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