Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/minifier): Fix ordering issue of analyzer (#6150)
**Description:** This is the groundwork for a parallel analyzer. This PR fixes the ordering issue of the analyzer so that the analyzer works identically regardless of the visit order. This patch contains some improvements because previously, we mixed `.and_modify()` and `.or_default()`.
- Loading branch information
Showing
6 changed files
with
64 additions
and
33 deletions.
There are no files selected for viewing
5 changes: 2 additions & 3 deletions
5
crates/swc/tests/tsc-references/classDeclarationLoop.2.minified.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
//// [classDeclarationLoop.ts] | ||
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; | ||
for(var _loop = function(i) { | ||
var C = function C() { | ||
arr.push(function C() { | ||
"use strict"; | ||
_class_call_check(this, C), this.prop = i; | ||
}; | ||
arr.push(C); | ||
}); | ||
}, arr = [], i = 0; i < 10; ++i)_loop(i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6d0ca05
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
es/full/minify/libraries/antd
1824713527
ns/iter (± 33930458
)1811893082
ns/iter (± 33101110
)1.01
es/full/minify/libraries/d3
375450355
ns/iter (± 23970141
)393089724
ns/iter (± 10584324
)0.96
es/full/minify/libraries/echarts
1516119864
ns/iter (± 36719876
)1508830672
ns/iter (± 35998491
)1.00
es/full/minify/libraries/jquery
100387846
ns/iter (± 6271039
)100476414
ns/iter (± 3588413
)1.00
es/full/minify/libraries/lodash
112000053
ns/iter (± 9631144
)111876117
ns/iter (± 3054315
)1.00
es/full/minify/libraries/moment
56862192
ns/iter (± 4177587
)57493639
ns/iter (± 1051511
)0.99
es/full/minify/libraries/react
20054124
ns/iter (± 371796
)20026269
ns/iter (± 606495
)1.00
es/full/minify/libraries/terser
290622064
ns/iter (± 8349644
)299985776
ns/iter (± 7252542
)0.97
es/full/minify/libraries/three
547069130
ns/iter (± 10271462
)550101655
ns/iter (± 16946327
)0.99
es/full/minify/libraries/typescript
3421326158
ns/iter (± 138630235
)3396285883
ns/iter (± 27230438
)1.01
es/full/minify/libraries/victory
799316171
ns/iter (± 15666128
)807114939
ns/iter (± 11567925
)0.99
es/full/minify/libraries/vue
137618887
ns/iter (± 4171876
)141763390
ns/iter (± 2485265
)0.97
es/full/codegen/es3
32514
ns/iter (± 1684
)33934
ns/iter (± 1024
)0.96
es/full/codegen/es5
32256
ns/iter (± 1748
)33800
ns/iter (± 2702
)0.95
es/full/codegen/es2015
33969
ns/iter (± 3145
)33915
ns/iter (± 1669
)1.00
es/full/codegen/es2016
34535
ns/iter (± 5596
)33809
ns/iter (± 377
)1.02
es/full/codegen/es2017
34098
ns/iter (± 3453
)33639
ns/iter (± 481
)1.01
es/full/codegen/es2018
34282
ns/iter (± 5135
)33264
ns/iter (± 455
)1.03
es/full/codegen/es2019
34493
ns/iter (± 5428
)33181
ns/iter (± 719
)1.04
es/full/codegen/es2020
33362
ns/iter (± 1990
)33216
ns/iter (± 1038
)1.00
es/full/all/es3
196293778
ns/iter (± 14848229
)188603219
ns/iter (± 6042524
)1.04
es/full/all/es5
185118336
ns/iter (± 11718494
)181207683
ns/iter (± 11639390
)1.02
es/full/all/es2015
150730756
ns/iter (± 9697185
)143509497
ns/iter (± 7454011
)1.05
es/full/all/es2016
147010672
ns/iter (± 15527691
)142218369
ns/iter (± 4629082
)1.03
es/full/all/es2017
149776392
ns/iter (± 11107354
)141869474
ns/iter (± 5173579
)1.06
es/full/all/es2018
147581527
ns/iter (± 10105399
)140116498
ns/iter (± 5482962
)1.05
es/full/all/es2019
149861358
ns/iter (± 12082701
)139404192
ns/iter (± 3753114
)1.08
es/full/all/es2020
141100566
ns/iter (± 10257657
)135121416
ns/iter (± 6030583
)1.04
es/full/parser
722510
ns/iter (± 44273
)701564
ns/iter (± 24510
)1.03
es/full/base/fixer
26915
ns/iter (± 1569
)26345
ns/iter (± 955
)1.02
es/full/base/resolver_and_hygiene
97704
ns/iter (± 11847
)92522
ns/iter (± 1630
)1.06
serialization of ast node
213
ns/iter (± 42
)206
ns/iter (± 3
)1.03
serialization of serde
214
ns/iter (± 30
)209
ns/iter (± 4
)1.02
This comment was automatically generated by workflow using github-action-benchmark.