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
SourceMap performance issue #6411
Comments
Additional information. |
I can repro this with
Not sure I can dig more without some additions to CONTRIBUTING.md about building the node package. Evidently I am doing something differently ( I did dig in pure-rust though... and as far as I got was seeing that serializing sourcemaps isn't benched in the swc/crates/swc/benches/minify.rs Line 49 in 48bbebf
BoolOrDataConfig::from_bool(true) I reckon.
Once it is... then the benchmark is massively slowed down (like, x10 slower or worse) by: swc/crates/swc_common/src/source_map.rs Line 974 in 48bbebf
Commenting that out or even using |
@kdy1 It seems that if the sourcefile contains lots chinese characters it will have serious performance problems, most of the time are spent on when I remove all the chinese character from code, the sourcemap generation cost reduce from 37s to 1s |
@hardfist Can you share a test input? |
Let's see if #6523 fixes it. |
Thanks ! |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Describe the bug
Input: A large bundle generated by webpack.
minify: 2s without
sourcemap
, and 20s withsourcemap
When minify and transform very large file, enable source map will have huge impact on performance, very huge impact that sometimes even slower than
terser
.Reprod repo here
Config
No response
Playground link
As the file is too large, I think we better download the reprod repo locally
Expected behavior
SourceMap should be slow to generate, but shouldn't be this slow
Actual behavior
2s without
sourcemap
20s with
sourcemap
Version
1.3.14
Additional context
No response
The text was updated successfully, but these errors were encountered: