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

fix(perf): reuse port-forwards when hot-reloading #476

Merged
merged 1 commit into from
Jan 25, 2019

Conversation

thsig
Copy link
Collaborator

@thsig thsig commented Jan 24, 2019

Added a simple in-process cache of port-forwards allocated for syncing
during hot-reloading.

This results in dramatic (often 50%) speedups for hot reloads subsequent
to the initial one, during the execution of the enclosing Garden command.

Addresses #458.

@eysi09
Copy link
Collaborator

eysi09 commented Jan 24, 2019

What does the speedup translate to in terms of milliseconds, for, say, the vote example?

@thsig thsig assigned thsig and unassigned thsig Jan 24, 2019
@thsig thsig added this to the 0.9.0 milestone Jan 24, 2019
@thsig
Copy link
Collaborator Author

thsig commented Jan 24, 2019

I did a couple of runs in the vote project, with the vote service configured for hot reloading (stopping and then re-running garden dev --hot-reload=vote after the first run). Here are the numbers:

First run

  • Initial hot reload: 335ms.
  • Next five hot reloads: 201ms, 206ms, 145ms, 216ms, 228ms (average: 119ms).
  • Average speedup compared to initial: 64%.

Second run

  • Initial hot reload: 327ms.
  • Next five hot reloads: 154ms, 142ms, 158ms, 229ms, 215ms (average: 179ms).
  • Average speedup compared to initial: 45%.

I got similar distributions and speedups in the gatsby-hot-reload example project, but a slightly larger speedup on average.

Copy link
Collaborator

@edvald edvald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment, otherwise great!

Added a simple in-process cache of port-forwards allocated for syncing
during hot-reloading.

This results in dramatic (often 50%) speedups for hot reloads subsequent
to the initial one, during the execution of the enclosing Garden command.
@thsig thsig force-pushed the cache-hot-reload-port-forward branch from 547c50f to 6db83a7 Compare January 25, 2019 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants