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

Merged
merged 6 commits into from Jul 23, 2019

Conversation

shadyvb
Copy link
Contributor

@shadyvb shadyvb 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 shadyvb requested a review from a team as a code owner June 2, 2019 23:11
@schlessera
Copy link
Member

Thanks, @shadyvb, awesome improvement!

@schlessera schlessera merged commit 8be8a5a into wp-cli:master Jul 23, 2019
@schlessera schlessera changed the title Speed up vagrant scheme calls by caching vagrant ssh-config Speed up vagrant scheme calls by caching vagrant ssh-config Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants