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

Write performance #10454

Merged
merged 6 commits into from Feb 28, 2019

Conversation

Projects
None yet
4 participants
@zodern
Copy link
Collaborator

commented Feb 14, 2019

JS minify performance
In development, most of the time spent minifying is from converting the content of the files to and from Buffers. This was done before minifying for dynamic files to rename the function, and afterwards for all files to restore the function name. These changes have it avoid converting the contents to and from buffers where possible, and only restores the function name for dynamic files. Saves ~400ms per rebuild in a larger app.

Skip calculating SRI for assets
The current SRI standard supports css and js files, and Meteor only uses it for the main css and js bundles. These changes disable calculating the SRI hash for assets since Meteor currently doesn't use it for assets. If some packages or apps want the SRI hash for js or css assets, then two alternatives are calculating it for production, or skipping it for assets that are not js and css files. Saves ~700ms per rebuild in one app.

Skip removing source map comments if the content won't be written
Before writing a file, Meteor removes source map comments that are in the middle of the file. These changes have it skip that step when the file's contents didn't change and it is building in place. Saved 300ms during rebuilds.

@KoenLav

This comment has been minimized.

Copy link

commented Feb 14, 2019

@zodern I think I'm speaking for a lot of us here when I say: thank you for all the efforts on build time improvements!

I guess the times mentioned here, and in your other recent PRs, are improvements even on top of the changes already implemented in the Meteor 1.8.1 beta?

@zodern

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 15, 2019

Thanks @KoenLav. Yes, the times are all additional, though they are from a larger app so most apps will probably not see as large of an improvement.

@smeijer

This comment has been minimized.

Copy link

commented Feb 18, 2019

Couldn't agree more with @KoenLav, I wanted to say the same thing in #10453.

@zodern, thanks for all the time and energy you're putting into this!

Now give this guy some merge permissions! 😄

zodern and others added some commits Feb 5, 2019

Skip calculating SRI for assets from the public/ folder.
Saves on average ~2ms per file in one app, which adds up when there are
hundreds. SRI is currently only supported for js and css files, and Meteor
only uses it for the main bundles.
Improve performance of minifying dynamic files.
Avoids converting file contents to and from buffers and strings. The
conversion had been done for dynamic files before minifying them, and all
files after they were minified.

@benjamn benjamn force-pushed the zodern:write-performance branch from 42c63ce to 01f515e Feb 28, 2019

@benjamn benjamn added this to the Release 1.8.1 milestone Feb 28, 2019

@benjamn
Copy link
Member

left a comment

Just rebased to see if the tests will pass now, but otherwise this looks great!

@benjamn benjamn merged commit c58ab5b into meteor:release-1.8.1 Feb 28, 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 Feb 28, 2019

@benjamn

This comment has been minimized.

Copy link
Member

commented Feb 28, 2019

@zodern Happy to add you as a collaborator with push/edit permissions, by the way. Just let me know if that sounds useful to you.

@zodern

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 2, 2019

@benjamn I think that would be useful, thanks. I sent you a message on the forums with a couple of questions.

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.
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.