Fix performance regression when a file is imported by many importers#3641
Merged
lukastaegert merged 2 commits intomasterfrom Jun 17, 2020
Merged
Fix performance regression when a file is imported by many importers#3641lukastaegert merged 2 commits intomasterfrom
lukastaegert merged 2 commits intomasterfrom
Conversation
Collaborator
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via or load it into the REPL: |
Codecov Report
@@ Coverage Diff @@
## master #3641 +/- ##
=======================================
Coverage 96.54% 96.54%
=======================================
Files 183 183
Lines 6244 6244
Branches 1830 1832 +2
=======================================
Hits 6028 6028
Misses 107 107
Partials 109 109
Continue to review full report at Codecov.
|
This file contains hidden or 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
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.
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Resolves #3640
Description
In Rollup 2.9.0, new properties
importersanddynamicImporterswere added tothis.getModuleInfo. While the graph was built, these properties were extended ver often for some files (in the example in #3640,reactand another file were imported both by more than 5000 files).These properties were also sorted and the logic was built in a way so that the properties were sorted after any new importer was added. Now if you add 5000 properties to an array and sort the array after each added property, this does not scale well.
This PR fixes this regression by only sorting when the
this.getModuleInfois actually called.