-
-
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
brew --prefix is slow #2938
Comments
maybe use |
This has been optimised pretty heavily already. I'm not seeing it ever take more than 0.03s here which seems more than fast enough (particularly if you cache the value in an environment variable). If there's a way of making it dramatically faster without altering behaviour: we'll accept a pull request. |
Huh, I'll try to figure out why my own machine is so much slower then.
…--
Kevin Burke
925.271.7005 | kev.inburke.com
On Mon, Jul 24, 2017 at 12:42 PM, Mike McQuaid ***@***.***> wrote:
Closed #2938 <#2938>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2938 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAOSI_AofkdvbEwjtNlpe5p-eTbP5Yntks5sRPPCgaJpZM4Ohhij>
.
|
I put
I timed |
If I am reading |
👍 to a PR for that. |
I write code that supports a lot of other developers, and try to provide a seamless installation experience. To provide portable installation instructions that work with Homebrew installations on every user's machine, I need to find the Homebrew root directory using
brew --prefix
.However, that's really slow; running
time brew --prefix
ten times on a 2015 Macbook Pro with 16GB RAM yielded results between 184ms and 347ms (it sped up as I ran it more often, though the uncached time is also important). This makes it infeasible to put at e.g. the top of a Makefile, or to use the output frombrew --prefix
as part of a Make target.Is there a way we can speed it up? 95% of the time I feel like the answer is
/usr/local
; can we optimize for that case? Can we store the answer in a file somewhere and check that before doing expensive work? (I can build caching myself/for the users I support but it would be a little more cumbersome than building it into Homebrew).The text was updated successfully, but these errors were encountered: