diff options
| author | Xu Cheng | 2015-09-27 16:52:14 +0800 | 
|---|---|---|
| committer | Xu Cheng | 2015-09-30 16:25:30 +0800 | 
| commit | 3b520cf195b6d766d134a1f2bd033347c714a143 (patch) | |
| tree | 31001ad53b1fcad563994aa328f82c59a7a805d8 /Library/Homebrew/cmd/info.rb | |
| parent | 6240e896b2b3405dd3ffdf892b60e5eed05707b1 (diff) | |
| download | brew-3b520cf195b6d766d134a1f2bd033347c714a143.tar.bz2 | |
cache taps
There are plenty of IO operations inside Tap object, and it will be more
when implementing formula alias reverse look up(e.g. list all of alias
names for a formula). So let's cache them.
Some benchmark:
$ time brew info $(brew ruby -e 'puts Formula.tap_names') > /dev/null
Before: 6.40s user 2.42s system 96% cpu 9.134 total
After: 4.75s user 0.77s system 97% cpu 5.637 total
Closes Homebrew/homebrew#44377.
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Homebrew/cmd/info.rb')
| -rw-r--r-- | Library/Homebrew/cmd/info.rb | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index a2b491e05..52d39ca15 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -69,7 +69,7 @@ module Homebrew    def github_info(f)      if f.tap?        user, repo = f.tap.split("/", 2) -      tap = Tap.new user, repo.gsub(/^homebrew-/, "") +      tap = Tap.fetch user, repo.gsub(/^homebrew-/, "")        if remote = tap.remote          path = f.path.relative_path_from(tap.path)          github_remote_path(remote, path) | 
