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

Use optimistic functions with assets #10452

Merged
merged 1 commit into from Feb 27, 2019
Merged

Conversation

@zodern
Copy link
Member

@zodern zodern commented Feb 14, 2019

Meteor currently reads and hashes each asset during every build. The watcher then uses the optimistic functions to read and hash the file, which stores a copy of the contents in memory. During rebuilds it then reads the file again, causing multiple copies of the file to be in memory.

This changes it to always use optimistic functions with assets. Starting with the second rebuild, this saves 1.5 - 2 seconds of garbage collection during each rebuild in one app in addition to not having to read or hash the files.

An alternative is to use fs.copyFile and avoid storing a copy of the file in memory: zodern@3696b30. It did reduce the tool's memory usage by 400mb for this app, but the initial build is several hundred milliseconds slower and rebuilds are the same as using optimistic functions on a Linux computer with a file system that does not support copy on write.

@benjamn benjamn merged commit 24e8d1d into meteor:release-1.8.1 Feb 27, 2019
18 checks passed
benjamn added a commit that referenced this issue Mar 9, 2019
Adding @zodern as a collaborator with write access (including
triage/review), based on contributions that demonstrate deep understanding
of the meteor/meteor codebase: #9887, #10399, #10452, #10453, #10454

Also updated other parts of CHANGELOG.md to reflect 2019 realities.
benjamn added a commit that referenced this issue Mar 13, 2019
Adding @zodern as a collaborator with write access (including
triage/review), based on contributions that demonstrate deep understanding
of the meteor/meteor codebase: #9887, #10399, #10452, #10453, #10454

Also updated other parts of CHANGELOG.md to reflect 2019 realities.
@zodern zodern mentioned this pull request May 20, 2019
benjamn added a commit that referenced this issue Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants