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

Optimistic session creation #3352

Merged
merged 2 commits into from Dec 20, 2018

Conversation

juancampa
Copy link
Contributor

@juancampa juancampa commented Dec 19, 2018

Problem

Launch takes too long

Solution

Not a complete solution but an improvement.

Normally a window is created, and when it's ready it sends a new message. When the main process receives the new message, it creates a new session.

Instead of waiting for the new message, the main process creates a session optimistically so that when the new messages is actually received, a session is already warmed up.

Benchmarks

This measures the time from when app/index.js first runs until the first session data message is sent to the renderer. Ran it 5 consecutive times.

canary: 749, 728, 765, 777, 762
this branch: 617, 656, 615, 590, 596

Averages:

canary this branch diff
756ms 614ms 142ms

Not a hell of a lot but doesn't hurt either. I've only tested on Linux, but should help even more on other platforms

@juancampa juancampa changed the title Perf optimistic session creation Optimistic session creation Dec 19, 2018
@juancampa juancampa added the 🎨 Type: Enhancement Issue or PR is an enhancement request/proposal for Hyper label Dec 19, 2018
@rauchg
Copy link
Member

rauchg commented Dec 20, 2018

Succinct and effective!

@rauchg rauchg merged commit a530908 into vercel:canary Dec 20, 2018
@juancampa
Copy link
Contributor Author

I also did a video recording (thanks @chabou!) to verify that the actual "time to prompt" was improved and got results that are consistent with the measurements above: ~150ms speed-up on Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎨 Type: Enhancement Issue or PR is an enhancement request/proposal for Hyper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants