4 Commits

Author SHA1 Message Date
Ruoyu Zhong
6328277f57
tap.sh: tweak naming
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2024-09-25 16:49:46 +08:00
Ruoyu Zhong
e9b158cd5c
Further simplify homebrew-tap calling
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2024-09-25 12:00:30 +08:00
Ruoyu Zhong
a8d57385cf
tap.sh: simplify
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2024-09-25 11:46:06 +08:00
Ruoyu Zhong
369fd3dcaf
Speed up brew tap for no arguments
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)
2024-09-25 01:50:43 +08:00