SIGN IN SIGN UP
Homebrew / brew UNCLAIMED

🍺 The missing package manager for macOS (or Linux)

0 0 185 Ruby

speedup bash completion loading suggestion in docs

The current suggestion for users shells out to `brew --prefix` three separate times, which has a non-zero overhead (as per quick benchmark below, approx 20ms per invocation). By making a minor change, the first invocation can be stored in a local variable to reduce shell startup time.

```
$ hyperfine --warmup=3 'brew --prefix'       
Benchmark #1: brew --prefix
  Time (mean ± σ):      21.3 ms ±   1.5 ms    [User: 8.8 ms, System: 10.6 ms]
  Range (min … max):    20.3 ms …  37.0 ms    128 runs
```
M
Matthew Rothenberg committed
dc30e9f64d0d1ee56db5dc4e5a0170b009427a47
Parent: 84085bd
Committed by GitHub <noreply@github.com> on 5/7/2019, 4:36:02 PM