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

perf: avoid execSync on openBrowser #12510

Merged
merged 1 commit into from
Mar 21, 2023

Conversation

patak-dev
Copy link
Member

@patak-dev patak-dev commented Mar 21, 2023

Description

openBrowser was blocking the node thread in OSX, this PR saves a bit of time by using exec instead. We don't really use the return value of openBrowser.

On M1, I'm getting ~200ms faster start after this PR

If --open is used, frameworks could trigger a transformRequest of the app entry point so the modules are already pre-processed when the browser finally opens and starts to request them. We could also try to add a cache to transformIndexHtml so we start right away for apps that have an index.html by default.

@ArnaudBarre could you check this, maybe there was another reason to make these sync.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@stackblitz
Copy link

stackblitz bot commented Mar 21, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@patak-dev patak-dev added performance Performance related enhancement p4-important Violate documented behavior or significantly improves performance (priority) labels Mar 21, 2023
@ArnaudBarre
Copy link
Member

LGTM

The fact that it was blocking was not a big deal for me because almost nothing happens while the browser is opening. But that's a good idea to "simulate" a / get so that the transformRequest jobs starts sooner (this should be done in parallel of the open browser call)

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Awesome!

@patak-dev patak-dev merged commit a2af2f0 into main Mar 21, 2023
@patak-dev patak-dev deleted the perf/avoid-exec-sync-when-opening-browser branch March 21, 2023 14:32
@patak-dev patak-dev mentioned this pull request Mar 22, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4-important Violate documented behavior or significantly improves performance (priority) performance Performance related enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants