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

Speed up brew --prefix #2940

Merged
merged 1 commit into from Jul 25, 2017

Conversation

Projects
None yet
2 participants
@kevinburke
Copy link
Contributor

kevinburke commented Jul 25, 2017

  • 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 tests with your changes locally?

Move --prefix, --cellar to the top of brew.sh. Timings on master:

brew --prefix > /dev/null  0.05s user 0.03s system 46% cpu 0.165 total
brew --prefix > /dev/null  0.05s user 0.04s system 63% cpu 0.131 total
brew --prefix > /dev/null  0.04s user 0.03s system 72% cpu 0.104 total
brew --prefix > /dev/null  0.04s user 0.03s system 87% cpu 0.080 total
brew --prefix > /dev/null  0.04s user 0.03s system 81% cpu 0.080 total
brew --prefix > /dev/null  0.04s user 0.03s system 84% cpu 0.075 total
brew --prefix > /dev/null  0.04s user 0.03s system 83% cpu 0.080 total
brew --prefix > /dev/null  0.04s user 0.02s system 84% cpu 0.072 total
brew --prefix > /dev/null  0.04s user 0.03s system 86% cpu 0.072 total
brew --prefix > /dev/null  0.04s user 0.03s system 82% cpu 0.075 total
brew --prefix > /dev/null  0.04s user 0.03s system 85% cpu 0.072 total
brew --prefix > /dev/null  0.04s user 0.03s system 84% cpu 0.076 total
brew --prefix > /dev/null  0.04s user 0.03s system 85% cpu 0.074 total
brew --prefix > /dev/null  0.03s user 0.03s system 83% cpu 0.073 total
brew --prefix > /dev/null  0.04s user 0.02s system 83% cpu 0.072 total
brew --prefix > /dev/null  0.03s user 0.03s system 86% cpu 0.068 total
brew --prefix > /dev/null  0.04s user 0.03s system 82% cpu 0.080 total
brew --prefix > /dev/null  0.04s user 0.03s system 84% cpu 0.079 total
brew --prefix > /dev/null  0.04s user 0.02s system 83% cpu 0.070 total
brew --prefix > /dev/null  0.03s user 0.03s system 84% cpu 0.072 total

With the patch applied:

brew --prefix > /dev/null  0.02s user 0.02s system 24% cpu 0.157 total
brew --prefix > /dev/null  0.02s user 0.03s system 53% cpu 0.078 total
brew --prefix > /dev/null  0.02s user 0.02s system 64% cpu 0.056 total
brew --prefix > /dev/null  0.02s user 0.03s system 74% cpu 0.065 total
brew --prefix > /dev/null  0.01s user 0.02s system 73% cpu 0.049 total
brew --prefix > /dev/null  0.01s user 0.02s system 77% cpu 0.050 total
brew --prefix > /dev/null  0.01s user 0.02s system 64% cpu 0.054 total
brew --prefix > /dev/null  0.01s user 0.02s system 77% cpu 0.049 total
brew --prefix > /dev/null  0.01s user 0.02s system 56% cpu 0.061 total
brew --prefix > /dev/null  0.02s user 0.02s system 66% cpu 0.060 total
brew --prefix > /dev/null  0.01s user 0.02s system 62% cpu 0.057 total
brew --prefix > /dev/null  0.01s user 0.02s system 71% cpu 0.052 total
brew --prefix > /dev/null  0.02s user 0.03s system 67% cpu 0.063 total
brew --prefix > /dev/null  0.01s user 0.02s system 70% cpu 0.042 total
brew --prefix > /dev/null  0.02s user 0.02s system 68% cpu 0.056 total
brew --prefix > /dev/null  0.01s user 0.02s system 73% cpu 0.049 total
brew --prefix > /dev/null  0.01s user 0.02s system 62% cpu 0.058 total
brew --prefix > /dev/null  0.02s user 0.02s system 67% cpu 0.058 total
brew --prefix > /dev/null  0.01s user 0.02s system 73% cpu 0.043 total
brew --prefix > /dev/null  0.01s user 0.02s system 65% cpu 0.055 total
Speed up brew --prefix
Move --prefix, --cellar to the top of brew.sh. Timings on master:

    brew --prefix > /dev/null  0.05s user 0.03s system 46% cpu 0.165 total
    brew --prefix > /dev/null  0.05s user 0.04s system 63% cpu 0.131 total
    brew --prefix > /dev/null  0.04s user 0.03s system 72% cpu 0.104 total
    brew --prefix > /dev/null  0.04s user 0.03s system 87% cpu 0.080 total
    brew --prefix > /dev/null  0.04s user 0.03s system 81% cpu 0.080 total
    brew --prefix > /dev/null  0.04s user 0.03s system 84% cpu 0.075 total
    brew --prefix > /dev/null  0.04s user 0.03s system 83% cpu 0.080 total
    brew --prefix > /dev/null  0.04s user 0.02s system 84% cpu 0.072 total
    brew --prefix > /dev/null  0.04s user 0.03s system 86% cpu 0.072 total
    brew --prefix > /dev/null  0.04s user 0.03s system 82% cpu 0.075 total
    brew --prefix > /dev/null  0.04s user 0.03s system 85% cpu 0.072 total
    brew --prefix > /dev/null  0.04s user 0.03s system 84% cpu 0.076 total
    brew --prefix > /dev/null  0.04s user 0.03s system 85% cpu 0.074 total
    brew --prefix > /dev/null  0.03s user 0.03s system 83% cpu 0.073 total
    brew --prefix > /dev/null  0.04s user 0.02s system 83% cpu 0.072 total
    brew --prefix > /dev/null  0.03s user 0.03s system 86% cpu 0.068 total
    brew --prefix > /dev/null  0.04s user 0.03s system 82% cpu 0.080 total
    brew --prefix > /dev/null  0.04s user 0.03s system 84% cpu 0.079 total
    brew --prefix > /dev/null  0.04s user 0.02s system 83% cpu 0.070 total
    brew --prefix > /dev/null  0.03s user 0.03s system 84% cpu 0.072 total

With the patch applied:

    brew --prefix > /dev/null  0.02s user 0.02s system 24% cpu 0.157 total
    brew --prefix > /dev/null  0.02s user 0.03s system 53% cpu 0.078 total
    brew --prefix > /dev/null  0.02s user 0.02s system 64% cpu 0.056 total
    brew --prefix > /dev/null  0.02s user 0.03s system 74% cpu 0.065 total
    brew --prefix > /dev/null  0.01s user 0.02s system 73% cpu 0.049 total
    brew --prefix > /dev/null  0.01s user 0.02s system 77% cpu 0.050 total
    brew --prefix > /dev/null  0.01s user 0.02s system 64% cpu 0.054 total
    brew --prefix > /dev/null  0.01s user 0.02s system 77% cpu 0.049 total
    brew --prefix > /dev/null  0.01s user 0.02s system 56% cpu 0.061 total
    brew --prefix > /dev/null  0.02s user 0.02s system 66% cpu 0.060 total
    brew --prefix > /dev/null  0.01s user 0.02s system 62% cpu 0.057 total
    brew --prefix > /dev/null  0.01s user 0.02s system 71% cpu 0.052 total
    brew --prefix > /dev/null  0.02s user 0.03s system 67% cpu 0.063 total
    brew --prefix > /dev/null  0.01s user 0.02s system 70% cpu 0.042 total
    brew --prefix > /dev/null  0.02s user 0.02s system 68% cpu 0.056 total
    brew --prefix > /dev/null  0.01s user 0.02s system 73% cpu 0.049 total
    brew --prefix > /dev/null  0.01s user 0.02s system 62% cpu 0.058 total
    brew --prefix > /dev/null  0.02s user 0.02s system 67% cpu 0.058 total
    brew --prefix > /dev/null  0.01s user 0.02s system 73% cpu 0.043 total
    brew --prefix > /dev/null  0.01s user 0.02s system 65% cpu 0.055 total

@MikeMcQuaid MikeMcQuaid merged commit 53038a1 into Homebrew:master Jul 25, 2017

3 checks passed

codecov/patch Coverage not affected when comparing f0ca310...be1764c
Details
codecov/project 65.86% remains the same compared to f0ca310
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@MikeMcQuaid

This comment has been minimized.

Copy link
Member

MikeMcQuaid commented Jul 25, 2017

Thanks for your first contribution to Homebrew/brew, @kevinburke! Without people like you submitting PRs we couldn't run this project. You rock!

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.