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

Tweak package-lock to avoid loading `fs-extra` twice on main-process #19534

Merged
merged 1 commit into from Jun 18, 2019

Conversation

@rafeca
Copy link
Contributor

commented Jun 14, 2019

Following the instructions on #19269 I've identified that during the main process startup flow we're loading the fs-extra (and all its dependant modules) twice: once for @atom/watcher and another time for @atom/nsfw (details).

Both of them have the same version (v7.0.1), but for some reason the npm lock file at some point in the past decided to put an older version (v4.0.3) which is used by the github package on the root folder, and this prevented these two duplicates of the same version to be hoisted up on the dependency tree.

In this PR I've modified manually the package-lock file to make npm recalculate the best hoisting for modules, so libraries don't get duplicated (the manual modifications consisted on deleting all the fs-extra instances on the package-lock).

With this, the number of modules loaded during the main process start gets reduced from 373 to 286.

I've tried to check if this impacted startup time but I couldn't see noticeable changes (something around ~10-20ms only, and still hard to tell if it was just attributed to noise), but this could have more impact on other slower platforms.

@rafeca rafeca requested a review from nathansobo Jun 14, 2019

@rafeca

This comment has been minimized.

Copy link
Contributor Author

commented Jun 18, 2019

I'm gonna merge this one since it only changes the package-lock.json file, if there's any concern afterwards I can revert

@rafeca rafeca merged commit 9406934 into master Jun 18, 2019

1 check passed

Atom Pull Requests #20190614.4 succeeded
Details

@nathansobo nathansobo deleted the tweak-package-lock branch Jun 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.