You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the current behavior?
As discussed in #7378, TS type-only import/exports cause a large number of HarmonyLinking/WebpackError. In a sufficiently large project like ours, there are thousands of these errors. While the warnings existing don't cause much issue (since we just use ignoreWarnings regex to block them out), I noticed some interesting perf issues when creating these errors.
If the current behavior is a bug, please provide the steps to reproduce.
When creating these errors, Error.captureStackTrace is called. Based on our webpack perf CPU profiles, it seems that calling this function so many times really causes runtime cost to add up. In our traces, we weback serve dev command takes 9 seconds with this call disabled, down from 12 when enabled.
Since all these errors extend WebpackError which already extends Error, I think this captureStackTrace line isnt even necessary,since stack is automatically captured when new-ing up an error. There is a chance in some cases that we get a few extra stack lines within the error due to the frame hiding done when passing the constructor, but my just looking at the errors/warnings we were producing didn’t notice any difference.
What is the expected behavior? Error.captureStackTrace doesn’t even need to be called due to Error inheritance, so just remove it
Other relevant information:
webpack version: 5.38.1
Node.js version: 16.2.0
Operating System: Windows
Additional tools: --
The text was updated successfully, but these errors were encountered:
Bug report
Related to #7378
What is the current behavior?
As discussed in #7378, TS type-only import/exports cause a large number of HarmonyLinking/WebpackError. In a sufficiently large project like ours, there are thousands of these errors. While the warnings existing don't cause much issue (since we just use
ignoreWarnings
regex to block them out), I noticed some interesting perf issues when creating these errors.If the current behavior is a bug, please provide the steps to reproduce.
When creating these errors,
Error.captureStackTrace
is called. Based on our webpack perf CPU profiles, it seems that calling this function so many times really causes runtime cost to add up. In our traces, we weback serve dev command takes 9 seconds with this call disabled, down from 12 when enabled.Since all these errors extend WebpackError which already extends Error, I think this captureStackTrace line isnt even necessary,since stack is automatically captured when new-ing up an error. There is a chance in some cases that we get a few extra stack lines within the error due to the frame hiding done when passing the constructor, but my just looking at the errors/warnings we were producing didn’t notice any difference.
What is the expected behavior?
Error.captureStackTrace
doesn’t even need to be called due to Error inheritance, so just remove itOther relevant information:
webpack version: 5.38.1
Node.js version: 16.2.0
Operating System: Windows
Additional tools: --
The text was updated successfully, but these errors were encountered: