-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(es/minifier): Drop
new
token if possible (#4932)
- Loading branch information
1 parent
565f06f
commit 5940894
Showing
106 changed files
with
1,024 additions
and
951 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
2 changes: 1 addition & 1 deletion
2
...rences/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument_es2015.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,5 +1,5 @@ | ||
var A; | ||
!function(A1) { | ||
var beez; | ||
A1.beez2 = new Array(), A1.beez = beez; | ||
A1.beez2 = Array(), A1.beez = beez; | ||
}(A || (A = {})); |
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
Empty file.
Empty file.
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
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/controlFlowIIFE_es5.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,5 +1,5 @@ | ||
var maybeNumber, test; | ||
import _async_to_generator from "@swc/helpers/lib/_async_to_generator.js"; | ||
import regeneratorRuntime from "regenerator-runtime"; | ||
if (maybeNumber = 1, ++maybeNumber, maybeNumber++, !test) throw new Error("Test is not defined"); | ||
if (maybeNumber = 1, ++maybeNumber, maybeNumber++, !test) throw Error("Test is not defined"); | ||
test.slice(1); |
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 |
---|---|---|
|
@@ -4,5 +4,5 @@ function f15(x) { | |
f15({ | ||
value: 10 | ||
}), f15({ | ||
error: new Error("boom") | ||
error: Error("boom") | ||
}); |
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 |
---|---|---|
|
@@ -4,5 +4,5 @@ function f15(x) { | |
f15({ | ||
value: 10 | ||
}), f15({ | ||
error: new Error("boom") | ||
error: Error("boom") | ||
}); |
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/exportSpellingSuggestion_es2015.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,3 +1,3 @@ | ||
export function assertNever(x, msg) { | ||
throw new Error("Unexpected " + msg); | ||
throw Error("Unexpected " + msg); | ||
} |
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/exportSpellingSuggestion_es5.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,3 +1,3 @@ | ||
export function assertNever(x, msg) { | ||
throw new Error("Unexpected " + msg); | ||
throw Error("Unexpected " + msg); | ||
} |
8 changes: 4 additions & 4 deletions
8
crates/swc/tests/tsc-references/fixSignatureCaching_es2015.2.minified.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 4 additions & 4 deletions
8
crates/swc/tests/tsc-references/fixSignatureCaching_es5.2.minified.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/functionConstraintSatisfaction2_es2015.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,3 +1,3 @@ | ||
!function(x) { | ||
return x; | ||
}(()=>{}, 1), new Function(); | ||
}(()=>{}, 1), Function(); |
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 |
---|---|---|
|
@@ -9,4 +9,4 @@ var C = function() { | |
"use strict"; | ||
_class_call_check(this, C2); | ||
}; | ||
new Function(); | ||
Function(); |
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/functionConstraintSatisfaction_es2015.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 +1 @@ | ||
new Function(); | ||
Function(); |
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
4 changes: 2 additions & 2 deletions
4
crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es2015.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
4 changes: 2 additions & 2 deletions
4
crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es5.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
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
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/parser15.4.4.14-9-2_es2015.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
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/parser15.4.4.14-9-2_es5.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
Empty file.
Empty file.
Oops, something went wrong.
5940894
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
1676662222
ns/iter (± 60331285
)1801856233
ns/iter (± 67535184
)0.93
es/full/minify/libraries/d3
414726747
ns/iter (± 12893612
)449663924
ns/iter (± 3775355
)0.92
es/full/minify/libraries/echarts
2094202284
ns/iter (± 21275825
)2319792247
ns/iter (± 44284565
)0.90
es/full/minify/libraries/jquery
89699402
ns/iter (± 655131
)98193511
ns/iter (± 2413158
)0.91
es/full/minify/libraries/lodash
127431103
ns/iter (± 1441904
)135908126
ns/iter (± 1407229
)0.94
es/full/minify/libraries/moment
52566742
ns/iter (± 190958
)57053307
ns/iter (± 1174923
)0.92
es/full/minify/libraries/react
17291269
ns/iter (± 70553
)18215146
ns/iter (± 358057
)0.95
es/full/minify/libraries/terser
428031610
ns/iter (± 8306546
)504202583
ns/iter (± 8284465
)0.85
es/full/minify/libraries/three
521521700
ns/iter (± 13682508
)624186581
ns/iter (± 23548179
)0.84
es/full/minify/libraries/typescript
3924215095
ns/iter (± 13891072
)4262301967
ns/iter (± 25221516
)0.92
es/full/minify/libraries/victory
693154806
ns/iter (± 22106244
)762201324
ns/iter (± 15040280
)0.91
es/full/minify/libraries/vue
140171552
ns/iter (± 2706907
)148445357
ns/iter (± 1762410
)0.94
es/full/codegen/es3
34501
ns/iter (± 281
)36204
ns/iter (± 1580
)0.95
es/full/codegen/es5
34428
ns/iter (± 177
)35508
ns/iter (± 1234
)0.97
es/full/codegen/es2015
34495
ns/iter (± 173
)34715
ns/iter (± 1428
)0.99
es/full/codegen/es2016
34511
ns/iter (± 174
)34082
ns/iter (± 1371
)1.01
es/full/codegen/es2017
34502
ns/iter (± 171
)34651
ns/iter (± 1586
)1.00
es/full/codegen/es2018
34467
ns/iter (± 209
)35408
ns/iter (± 1679
)0.97
es/full/codegen/es2019
34484
ns/iter (± 150
)34974
ns/iter (± 1303
)0.99
es/full/codegen/es2020
34442
ns/iter (± 159
)34432
ns/iter (± 1374
)1.00
es/full/all/es3
192990777
ns/iter (± 1032950
)208220769
ns/iter (± 3963579
)0.93
es/full/all/es5
181635090
ns/iter (± 937729
)197687643
ns/iter (± 4165791
)0.92
es/full/all/es2015
145088478
ns/iter (± 922859
)158034904
ns/iter (± 3878207
)0.92
es/full/all/es2016
143935174
ns/iter (± 1148431
)156554170
ns/iter (± 3243915
)0.92
es/full/all/es2017
143742248
ns/iter (± 960747
)153853669
ns/iter (± 3870914
)0.93
es/full/all/es2018
141956883
ns/iter (± 1036337
)152434401
ns/iter (± 4092637
)0.93
es/full/all/es2019
140383230
ns/iter (± 819181
)151666129
ns/iter (± 3539084
)0.93
es/full/all/es2020
136467606
ns/iter (± 1111032
)146675726
ns/iter (± 3248459
)0.93
es/full/parser
583926
ns/iter (± 54544
)607017
ns/iter (± 55977
)0.96
es/full/base/fixer
27914
ns/iter (± 185
)29157
ns/iter (± 1279
)0.96
es/full/base/resolver_and_hygiene
140415
ns/iter (± 1650
)143821
ns/iter (± 7008
)0.98
serialization of ast node
181
ns/iter (± 1
)185
ns/iter (± 6
)0.98
serialization of serde
181
ns/iter (± 0
)192
ns/iter (± 7
)0.94
This comment was automatically generated by workflow using github-action-benchmark.