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
cmd/audit: improve performance of versioned formula names #16010
cmd/audit: improve performance of versioned formula names #16010
Conversation
There is a check for other versioned formula with the same name in the file audit. This just memoizes all of the versioned formulae in a tap during the first call and then uses that much shorter list everytime it checks for things.
Yeah I had identified the same: https://github.com/Homebrew/brew/pull/16007/files#diff-61f7b22029742d3ce5a09055c06c73368cc9a06b965af5c172553731eb0855b6R650 Looks like your version is a little more fleshed out though. |
@Bo98 I'd overlooked that when reviewing your PR. My bad. |
It looks like this also speeds up formula API generation as well. Before: (from #16008) After: |
Great work as usual @apainintheneck! |
lima@lima-ubuntu-lts:~$ ruby -v lima@lima-ubuntu-lts:~$ echo $PATH lima@lima-ubuntu-lts:~$ ./install.sh Press RETURN/ENTER to continue or any other key to abort:
Failed during: /home/linuxbrew/.linuxbrew/bin/brew update --force --quiet |
@zouchengli It's not obvious from the stack trace that this problem is related to this PR. Could you either make an issue in the install repo or open a discussion so that we can better troubleshoot this? |
OK Please refer to Try install homebrew on arm64 ubuntu |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?There is a check for other versioned formula with the same name in the file audit. This just memoizes all of the versioned formulae in a tap during the first call and then uses that much shorter list every time it checks for things.
Command:
Before:
After:
It results in a 5-10 second speed up locally for me.
Update: It looks like we're down to ~35 seconds in this repo's CI after this change and @Bo98's change in #16008.