-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
feat(mangler): reuse variable names #8562
base: main
Are you sure you want to change the base?
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
dd44926
to
4d6c3ee
Compare
CodSpeed Performance ReportMerging #8562 will degrade performances by 72.24%Comparing Summary
Benchmarks breakdown
|
4d6c3ee
to
1b9026f
Compare
The perf regression looks really bad, but if you take a step back and see the overall minifier timings, it's not that big regression. antd: 196.8ms (6.4ms is 3.3%) |
Just to raise one other concern: The addition of This is quite difficult already, and if The changes to FYI: The bigger picture is: Currently we run semantic analysis multiple times during the pipeline. The hope (well certainly my hope) is that we can eventually make all stages of the pipeline keep semantic data in sync with AST changes. Then we'll be able to remove these extra semantic passes, which will be a large perf improvement. The performance issue needs to be looked at first. But if we decide that it's worth it (very possibly it is), I would suggest the following:
It will of course be achievable with some effort, but it'd be useful to understand how much effort before we go ahead. Maybe it's easier than I think! cc @Dunqing Last thing: I'm not very familiar with the mangler. Could you possibly give a brief explanation of how this algorithm works? I'm wondering if any other way to achieve the effect without the |
Changed the mangler to reuse variable names where possible.
This will reduce the code size as shorter variable names can be used in more places. But requires global information and limits parallelism in a single file and requires more memory.