heroku / cli

Heroku CLI
https://devcenter.heroku.com/articles/heroku-cli
ISC License
854 stars 224 forks source link

Slow startup time when using plugins #2238

Open jeffmoss opened 1 year ago

jeffmoss commented 1 year ago

What is the current behavior?

Currently if you install some plugins the CLI slows down considerably, for example the heroku-pg-extras plugin:

Before

heroku ps -a myapp  0.49s user 0.27s system 33% cpu 2.316 total

After

$ heroku plugins:install heroku-pg-extras
heroku ps -a myapp  1.33s user 1.32s system 41% cpu 6.377 total

What is the expected behavior?

I would expect some commands like ps would not load the entire plugin suite, saving time.

k80bowman commented 1 year ago

Thank you for letting us know. We'll look into it.

nlindley commented 1 month ago

To add another data point, the heroku-kafka plugin adds nearly 5 seconds to startup. Here are some timings with no plugins, then just after adding heroku-kafka.

> time heroku version
heroku/9.2.1 darwin-arm64 node-v16.20.2

________________________________________________________
Executed in    1.04 secs      fish           external
   usr time  267.60 millis    0.13 millis  267.46 millis
   sys time  115.09 millis    2.15 millis  112.94 millis

> heroku plugins:install heroku-kafka
> time heroku version
heroku/9.2.1 darwin-arm64 node-v16.20.2

________________________________________________________
Executed in    5.91 secs      fish           external
   usr time  717.23 millis    0.11 millis  717.12 millis
   sys time  653.56 millis    1.17 millis  652.40 millis