Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up vagrant scheme calls by caching vagrant ssh-config #5235

Open
wants to merge 6 commits into
base: master
from

Conversation

1 participant
@shadyvb
Copy link
Contributor

commented Jun 2, 2019

Hello!

This improves handling for vagrant scheme by caching the output of vagrant ssh-config, and using values within to convert the call to use the standard ssh scheme.

This helps speed up sample requests up to 3 seconds ( ie: sometimes 700% ) in all calls.

Before:

time wp --ssh=vagrant:default cli version                                                                                  WP-CLI 2.1.0
Connection to 127.0.0.1 closed.
        3.23 real         2.26 user         0.43 sys

time wp --ssh=vagrant:default option get siteurl                                                                          
https:///wordpress
Connection to 127.0.0.1 closed.
        4.14 real         2.27 user         0.44 sys

After:

time wp --ssh=vagrant:default cli version                                                                                  WP-CLI 2.1.0
        0.54 real         0.28 user         0.04 sys

time wp --ssh=vagrant:default option get siteurl                                                                          
https:///wordpress
        1.34 real         0.27 user         0.03 sys

Also fixed handling of vagrant connection URL so it behaves more consistently with the rest of connection types.

Fun irrelevant realization I couldn't resist to share: Shaving a minute a day off a developer's time, multiplied by 22 days a month, equals 22 minutes, multiplied by 30 developers a company, equals 11 hours a month, which is more than a billable day for agencies! And that doesn't even include the cost of interruptions!

shadyvb added some commits Jun 2, 2019

@shadyvb shadyvb requested a review from wp-cli/committers as a code owner Jun 2, 2019

shadyvb added some commits Jun 3, 2019

Revert "Move back the -t arg"
This reverts commit 2216731.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.