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

Snapshot `AtomEnvironment` #14024

Merged
merged 21 commits into from Mar 21, 2017

Conversation

Projects
None yet
3 participants
@as-cii
Member

as-cii commented Mar 17, 2017

This pull request is a continuation of #13916 and takes advantage of snapshots to create an AtomEnviroment instance as part of script/build. Then, at runtime, Atom can simply use this instance and complete its initialization by supplying all the information we didn't have at compile-time: setting the ATOM_HOME, reading the user configuration, etc.

The following is a profile of how long it takes to initialize an AtomEnvironment on master:

screen shot 2017-03-17 at 16 43 10

After these changes, this is how the same profile looks like:

screen shot 2017-03-17 at 16 38 51

You can notice how creating an AtomEnvironment is ~2x faster now, as it went down from ~106ms to ~58ms.

It's worth noting that just loading the base style sheets took more than ~30ms (more than half of the initialize method). This is due to performing a lot of synchronous I/O but it can be almost eliminated by, again, making use of snapshots and load as much data as possible during script/build. This will be addressed in a forthcoming pull request.

/cc: @atom/maintainers

as-cii added a commit to atom/keybinding-resolver that referenced this pull request Mar 20, 2017

Allow opening keymaps starting with `core/`
This will be used in atom/atom#14024 where
keymaps are loaded during snapshot. Since we are unable to supply an
absolute path when that code runs, we will instead use `core/` in order
to allow this package to understand if it needs to extract a bundled
keymap from Atom's package.json.
@nathansobo

This comment has been minimized.

Show comment
Hide comment
@nathansobo

nathansobo Mar 20, 2017

Contributor

Making great progress.

Contributor

nathansobo commented Mar 20, 2017

Making great progress.

@Ben3eeE

This comment has been minimized.

Show comment
Hide comment
@Ben3eeE

Ben3eeE Mar 21, 2017

Member

Tested this out and did not find any issues 🚢

Member

Ben3eeE commented Mar 21, 2017

Tested this out and did not find any issues 🚢

@as-cii as-cii merged commit cebe8ad into master Mar 21, 2017

4 of 5 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@as-cii as-cii deleted the as-snapshot-atom-environment branch Mar 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment