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

Conversation

Projects
None yet
2 participants
@zodern
Copy link
Collaborator

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

CLA Author has signed the Meteor CLA.
Details
ci/circleci: Clean Up Your tests passed on CircleCI!
Details
ci/circleci: Docs Your tests passed on CircleCI!
Details
ci/circleci: Get Ready Your tests passed on CircleCI!
Details
ci/circleci: Isolated Tests Your tests passed on CircleCI!
Details
ci/circleci: Test Group 0 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 1 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 10 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 2 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 3 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 4 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 5 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 6 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 7 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 8 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 9 Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

benjamn added a commit that referenced this pull request Mar 9, 2019

Update CONTRIBUTING.md, adding @zodern as a collaborator.
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 pull request Mar 13, 2019

Update CONTRIBUTING.md, adding @zodern as a collaborator. (#10485)
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 referenced this pull request May 20, 2019

Open

Fix watching assets #10565

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