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
Improve performance of finding files in node_modules #10839
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filipenevola
approved these changes
Dec 24, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
@benjamn, @filipenevola, @zodern, any reason this has not been merged? |
Hi @brucejo75 we are going to include this on Meteor 1.10.3 |
Thanks @zodern, it's published on 1.10.3-beta.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The improvements are measured with a smaller medium sized app on windows, with 45 direct npm dependencies. Some of the times are approximate since I didn't record exact before and after times for each change.
Share Cache Keys between Archs
The list of files in node_modules is currently cached separately for each arch. By removing the arch name from the cache key and instead including the options that change between arches, the cache entries can be shared. For most apps, this will allow the legacy architecture to use the cache during the initial build instead of redoing the work done for the modern bundle. Saves >1s during the initial build. I haven't tested it, but the cordova web arch might also be able to use the cache during the initial build.
Reduce node_modules cache entries
Meteor creates a separate cache entry for each folder in node_modules. For this app the cache was using 10mb of memory. Only one entry is used by each architecture during rebuilds. It will now only cache the results that will be used in rebuilds, reducing the cache memory usage to 8kb.
Do not watch node_modules after initial build
During the initial build, Meteor adds files and folders in node_modules to the app's watch set. These are always missing after the first full rebuild. It will now not add node_modules to the app's watch set at all. The files seem to still be watched someplace else, but I haven't looked into why or where.