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
I'm working on updating SWC (from 1.2.205 to 1.3.4) and noticed that the latest version is very slow when trying to compress deeply nested conditions. We are using peggy.js which can quickly generate some very deep nesting. As the nesting approaches a depth of ~20, compression seems to slow down exponentially, and is on the order of many seconds even for a relatively small file size.
The "large" file is only 600 lines long, but has over 20 levels of nesting here. This file takes ~20 seconds to compress. If I set compress.unused = false, it is almost instant.
I believe this is a duplicate of #5470, but that issue was closed because they were unable to provide a reproduction. I believe they were also using peggy, though they did not explicitly say so. They were also using deno, but I'm using Node.js.
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
I'm working on updating SWC (from
1.2.205
to1.3.4
) and noticed that the latest version is very slow when trying to compress deeply nested conditions. We are using peggy.js which can quickly generate some very deep nesting. As the nesting approaches a depth of ~20, compression seems to slow down exponentially, and is on the order of many seconds even for a relatively small file size.I was able to recreate the issue with some very basic peggy files - see https://github.com/dgreif/peggy-swc
The "large" file is only 600 lines long, but has over 20 levels of nesting here. This file takes ~20 seconds to compress. If I set
compress.unused = false
, it is almost instant.I believe this is a duplicate of #5470, but that issue was closed because they were unable to provide a reproduction. I believe they were also using peggy, though they did not explicitly say so. They were also using deno, but I'm using Node.js.
Input code
No response
Config
Playground link
No response
Expected behavior
SWC is blazing fast with all of our other code. I would expect it to handle deeply nested conditional statements with similar speed.
Actual behavior
No response
Version
1.3.4
Additional context
No response
The text was updated successfully, but these errors were encountered: