This provides a >3x speedup for `brew tap` with no arguments (i.e., when
listing taps). It also makes the completion significantly faster.
$ hyperfine --warmup=3 --setup 'git checkout {branch}' --parameter-list branch master,brew-tap-speedup 'brew tap'
Benchmark 1: brew tap (branch = master)
Time (mean ± σ): 1.405 s ± 0.080 s [User: 0.561 s, System: 0.238 s]
Range (min … max): 1.332 s … 1.549 s 10 runs
Benchmark 2: brew tap (branch = brew-tap-speedup)
Time (mean ± σ): 404.1 ms ± 124.8 ms [User: 107.9 ms, System: 200.7 ms]
Range (min … max): 308.8 ms … 693.7 ms 10 runs
Summary
brew tap (branch = brew-tap-speedup) ran
3.48 ± 1.09 times faster than brew tap (branch = master)