-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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 Tap#formula_files_by_name
.
#16777
Conversation
@@ -1201,7 +1201,6 @@ def self.find_formula_in_tap(name, tap) | |||
"#{name}.rb" | |||
end | |||
|
|||
Tap.formula_files_by_name(tap) | |||
.fetch(name, tap.formula_dir/filename) | |||
tap.formula_files_by_name.fetch(name, tap.formula_dir/filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tap.formula_files_by_name.fetch(name, tap.formula_dir/filename) | |
tap.formula_files_by_name.fetch(name) { tap.formula_dir/filename } |
To avoid building unnecessary Pathname
objects when the name is in the hash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@apainintheneck same deal as last PR: would like to see something like brew prof
show a measurable impact before doing these sorts of micro-optimisations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @reitermarkus!
@@ -1201,7 +1201,6 @@ def self.find_formula_in_tap(name, tap) | |||
"#{name}.rb" | |||
end | |||
|
|||
Tap.formula_files_by_name(tap) | |||
.fetch(name, tap.formula_dir/filename) | |||
tap.formula_files_by_name.fetch(name, tap.formula_dir/filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@apainintheneck same deal as last PR: would like to see something like brew prof
show a measurable impact before doing these sorts of micro-optimisations.
We essentially stopped caching these accidentally and they get called every time we try to load a cask or formula from the API. It gets really, really, really slow. I ran `brew deps --casks --eval-all` before and after the changes. I let it run for 3 minutes before killing it. No output had been printed to the screen. It finished printing all output (pages and pages of it) in less than a minute. --- This should match the caching behavior we had before the recent changes in these two PRs. - #16777 - #16775
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Extracted from #16730 for easier review.