-
-
Notifications
You must be signed in to change notification settings - Fork 281
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
Performance improvement #406
Conversation
Sets don't allow duplicates, so checking for `has` is not necessary webpack 5 makes these Sets lazy, which makes reading more expensive. So only the watcher should read from these Sets, which is called after the compilation has finished, so that doesn't contribute to build performance. LazySets also have a `addAll` method, which allows to add an Iterable lazily (only iterated when LazySet is read)
Codecov Report
@@ Coverage Diff @@
## master #406 +/- ##
==========================================
- Coverage 94.88% 94.84% -0.04%
==========================================
Files 9 9
Lines 293 291 -2
Branches 78 78
==========================================
- Hits 278 276 -2
Misses 14 14
Partials 1 1
Continue to review full report at Codecov.
|
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.
Thanks!
This is breaking webpack4 for us. I think it's a bad interaction with some library using corejs, but interestingly if i log out FYI |
@jquense it is custom webpack class and not related to corejs |
@evilebottnawi I realize that, the problem is that it checks if |
In other words checking |
@jquense what idea do you have to fix it? Maybe instance of solve this? |
either |
@jquense Can you send a PR? |
That would require i larger ecosystem change and i'm not sure what the desired approach would be. Generally happy to send PR's tho. @sokra should really be aware of this issue as well, b/c this test is likely in other places |
This PR contains a:
Motivation / Use-Case
Sets don't allow duplicates, so checking for
has
is not necessarywebpack 5 makes these Sets lazy, which makes reading more expensive.
So only the watcher should read from these Sets, which is called after the compilation has finished,
so that doesn't contribute to build performance.
LazySets also have a
addAll
method, which allows to add an Iterable lazily (only iterated when LazySet is read)Breaking Changes
No, webpack 4 compatibility is kept
Additional Info