Repository navigation
Lower browser process startup time - #3453
Conversation
7fccf3e to
e52a576
Compare
|
On Windows 8.1 VM with 2 cores and 8 GB of memory, the time dropped from |
|
Running the benchmark on Windows as well now, but I noticed it's important to run |
You shouldn't have to, this only involves recompiling the coffeescript file, which |
Hm ok, not important then. I did get a wildly different time before, but that actually could have been due to some other process' influence. |
|
@batjko Yeah on Windows, the very first launch seems to take longer on a fresh install. So try launching it once and quitting, and then run a few more time afterwards to get a ballpark time. |
e52a576 to
2c461cc
Compare
|
Ok, so I ran this on a Win8, AMD quad-core, 3.60GHz, 8GB machine and got from an average of
That's a pretty respectable improvement of what... -36%? Couple points:
|
Yeah, I updated the issue body to mention that script is mac only for now, sorry for the confusion. |
Yup window load time is next to investigate and improve. |
|
Looks like it was rebased. I checked out |
|
I ran on a 3.1GHz quad-core Core i5 iMac with 16GB of RAM. Before After It definitely brought down the top end significantly. |
Whoops, sorry about that, will update the instructions with the new commit. |
|
Hm, on linux the output is only: before: after: |
bade2e1 to
42f3605
Compare
Requiring it up front adds about 30-40ms to startup.
This require is heavy in node for some reason so only require it on Windows since it is only used there and only after a next tick so that it doesn't affect startup
Since only an is file check is performed fs is sufficient
This prevents it from adding time to first window startup
Lower browser process startup time
|
This will be included in the next Atom release, 0.126 |
|
🚄 ⚡ |
|
💖 |
Taking a look at the browser process startup time.
This is the time between when atom-shell require's Atom's main file and the first window is created.
This includes the time taken to parse the command line arguments, create the native windows, setup the crash reporter, setup the system menus, and start the auto updater.
This does not include the time take to reopen editors, show the tree view, or anything that happens inside the opened window, just everything between app launch and when the window is created.
I added a new benchmark that starts the app 10 times and averages the app startup time.
Before
After
This is on a Macbook Pro on OS X 10.8.5 with 2.6 Ghz Intel Core i7 processors and 16 GB of memory.
Note that doing a
new BrowserWindow()which creates the native window takes roughly40mson my machine so that would be the absolute minimum that we would get these times down to.Running the benchmark
I'd be curious what results other people see so if you want to post your before and after results do the following:
On Mac OS X
git checkout d7106a6b4to checkout the commit before the changes were madescript/buildbenchmark/browser-process-startup.coffeeto see the before resultsgit checkout ks-lower-browser-process-startup-timeto checkout the latest commitscript/buildagainbenchmark/browser-process-startup.coffeeto see the after resultsOn Linux/Windows
git checkout fbeb9ecto checkout the commit before the changes were madescript/buildatom -f .and look for an output line in the terminal that starts withApp load time:git checkout ks-lower-browser-process-startup-timeto checkout the latest commitscript/buildagainatom -f .again and look for an output line in the terminal that starts withApp load time:The two times will be the before and after results.
What changed
Much of the time spent on my machine was doing
requires of lots of files that weren't used until later on or possible never at all, but the requires were at the top of the files and so the first window wasn't being shown until all these requires were complete.Many of these were moved to be required right before use in response to an event or request from a render process.