-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
[Webpack 5] 3x slowdown caused by _discoverActiveExportsFromOtherStarExports #13107
Comments
I guess that can be improved |
I was unable to run you repro. (Probably windows-related issues, sounds like
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I didn't know you used Windows @sokra ! I've updated that branch which should work now. |
I'm looking into fixing that slowness. If you want an easy fix: 99% of that time is spend in a single file:
In contains 1721 lines of -export * from './accessible-icon-icon';
+export { AccessibleIconIcon } from './accessible-icon-icon';
And we haven't implemented caching for exports that depend on other modules... |
Just changing the star exports in the autogenerated code reduced reload times down to 3s. I'm sure your optimizations will help even more. Thanks @sokra !! |
Thank you so much. Have an amazing day!
…On Wed, Apr 14, 2021 at 8:00 AM zallen ***@***.***> wrote:
Just changing the star exports in the autogenerated code reduced reload
times down to 3s. I'm sure your optimizations will help even more. Thanks
@sokra <https://github.com/sokra> !!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#13107 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AR2YZ4PT7HC4USVQP3PQPKLTIWGYNANCNFSM42VR3H2A>
.
|
Bug report
What is the current behavior?
Upgrading to Webpack 5 takes 5s to livereload my browser between changes:
(the light green blocks at the bottom are calls to
getStarReexports
and the slow hotspot_discoverActiveExportsFromOtherStarExports
)Webpack 4 takes 3s:
If the current behavior is a bug, please provide the steps to reproduce.
git clone -b feat/webpack-5 https://github.com/patternfly/patternfly-org && cd patternfly-org && yarn && yarn start
packages/v4/src/pages/home.js
module: { unsafeCache: true }
andeager-imports-webpack-plugin
What is the expected behavior?
Webpack 5 to be faster than webpack 4. Simply changing
_discoverActiveExportsFromOtherStarExports
toreturn new Map();
speeds Webpack up 3x:In 95% of cases developers aren't touching star reexports.
I believe this is due to many included barrel files containing thousands of
export * from './file';
. Is there a way to speedup this_discoverActiveExportsFromOtherStarExports
hotspot (or avoid it altogether) besides changing library code toexport { list, of, named, exports } from './file';
?Other relevant information:
webpack version: webpack@5.31.0
Node.js version: v14.16.0
Operating System: linux
Relevant: #8644
The text was updated successfully, but these errors were encountered: