Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(es/minifier): Organize terser tests (#6247)
- Loading branch information
Showing
6 changed files
with
19 additions
and
23 deletions.
There are no files selected for viewing
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
3 changes: 1 addition & 2 deletions
3
crates/swc_ecma_minifier/tests/terser/compress/collapse_vars/collapse_vars_unary/output.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,6 +1,5 @@ | ||
function f0(o, p) { | ||
var x = o[p]; | ||
return delete x; | ||
return o[p], !0; | ||
} | ||
function f1(n) { | ||
return n > +!!n; | ||
|
8 changes: 3 additions & 5 deletions
8
crates/swc_ecma_minifier/tests/terser/compress/collapse_vars/var_defs/output.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,7 +1,5 @@ | ||
var f1 = function (x, y) { | ||
var r = x + y, | ||
a = r * r - r, | ||
b = 7; | ||
console.log(a + b); | ||
var f1 = function(x, y) { | ||
var r = x + y; | ||
console.log(r * r - r + 7); | ||
}; | ||
f1("1", 0); |
7 changes: 4 additions & 3 deletions
7
crates/swc_ecma_minifier/tests/terser/compress/collapse_vars/var_side_effects_2/output.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,6 +1,7 @@ | ||
var print = console.log.bind(console); | ||
function foo(x) { | ||
var twice = 2 * x.y; | ||
print("Foo:", twice); | ||
print("Foo:", 2 * x.y); | ||
} | ||
foo({ y: 10 }); | ||
foo({ | ||
y: 10 | ||
}); |
01edb4f
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/bugs-1
413795
ns/iter (± 20077
)349641
ns/iter (± 44357
)1.18
es/full/minify/libraries/antd
2013578744
ns/iter (± 45413342
)1819594156
ns/iter (± 86792731
)1.11
es/full/minify/libraries/d3
390547845
ns/iter (± 31387493
)374216731
ns/iter (± 12062793
)1.04
es/full/minify/libraries/echarts
1704129352
ns/iter (± 31177238
)1542027844
ns/iter (± 38517855
)1.11
es/full/minify/libraries/jquery
114639845
ns/iter (± 2082991
)98677472
ns/iter (± 3358755
)1.16
es/full/minify/libraries/lodash
141321460
ns/iter (± 3149692
)116251622
ns/iter (± 6095309
)1.22
es/full/minify/libraries/moment
124155576
ns/iter (± 29574186
)58454524
ns/iter (± 2262474
)2.12
es/full/minify/libraries/react
25326873
ns/iter (± 2992753
)21986171
ns/iter (± 2630383
)1.15
es/full/minify/libraries/terser
312746776
ns/iter (± 9812501
)301479603
ns/iter (± 12736907
)1.04
es/full/minify/libraries/three
532482669
ns/iter (± 26915749
)553712441
ns/iter (± 22965989
)0.96
es/full/minify/libraries/typescript
3790116593
ns/iter (± 81660888
)3357040591
ns/iter (± 87282545
)1.13
es/full/minify/libraries/victory
782618271
ns/iter (± 59720608
)802509289
ns/iter (± 27404387
)0.98
es/full/minify/libraries/vue
172810089
ns/iter (± 3431816
)150304989
ns/iter (± 10686816
)1.15
es/full/codegen/es3
39429
ns/iter (± 2789
)33855
ns/iter (± 1345
)1.16
es/full/codegen/es5
40071
ns/iter (± 2865
)33876
ns/iter (± 5879
)1.18
es/full/codegen/es2015
38257
ns/iter (± 2807
)33760
ns/iter (± 592
)1.13
es/full/codegen/es2016
39066
ns/iter (± 1348
)33777
ns/iter (± 580
)1.16
es/full/codegen/es2017
38540
ns/iter (± 1958
)33730
ns/iter (± 851
)1.14
es/full/codegen/es2018
38611
ns/iter (± 1797
)33960
ns/iter (± 1897
)1.14
es/full/codegen/es2019
39887
ns/iter (± 2290
)34146
ns/iter (± 899
)1.17
es/full/codegen/es2020
38580
ns/iter (± 1494
)33737
ns/iter (± 928
)1.14
es/full/all/es3
222064422
ns/iter (± 5598935
)191400310
ns/iter (± 10434365
)1.16
es/full/all/es5
211399283
ns/iter (± 7327180
)178154930
ns/iter (± 8035487
)1.19
es/full/all/es2015
170894992
ns/iter (± 8554800
)144574571
ns/iter (± 5291355
)1.18
es/full/all/es2016
169573948
ns/iter (± 6334468
)141418382
ns/iter (± 4254339
)1.20
es/full/all/es2017
168610335
ns/iter (± 13425787
)141396756
ns/iter (± 5399823
)1.19
es/full/all/es2018
165343930
ns/iter (± 6897689
)138937474
ns/iter (± 6252164
)1.19
es/full/all/es2019
164164489
ns/iter (± 5571963
)139991806
ns/iter (± 7717894
)1.17
es/full/all/es2020
158988979
ns/iter (± 6146350
)133694156
ns/iter (± 4151785
)1.19
es/full/parser
805844
ns/iter (± 38088
)704487
ns/iter (± 35616
)1.14
es/full/base/fixer
29050
ns/iter (± 1785
)25351
ns/iter (± 1712
)1.15
es/full/base/resolver_and_hygiene
104876
ns/iter (± 7312
)88823
ns/iter (± 2450
)1.18
serialization of ast node
255
ns/iter (± 18
)213
ns/iter (± 4
)1.20
serialization of serde
245
ns/iter (± 14
)226
ns/iter (± 27
)1.08
This comment was automatically generated by workflow using github-action-benchmark.
01edb4f
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.
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
2
.es/full/minify/libraries/moment
124155576
ns/iter (± 29574186
)58454524
ns/iter (± 2262474
)2.12
This comment was automatically generated by workflow using github-action-benchmark.
CC: @kdy1