-
-
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.
fix(html/minifier): Avoid optional attributes (#5016)
- Loading branch information
1 parent
5835794
commit f1fd83d
Showing
3 changed files
with
27 additions
and
1 deletion.
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
12 changes: 12 additions & 0 deletions
12
crates/swc_html_minifier/tests/fixture/attribute/html-xhtml/input.html
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html > | ||
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<head> | ||
<title>Title of the document</title> | ||
</head> | ||
|
||
<body> | ||
The content of the document...... | ||
</body> | ||
|
||
</html> |
4 changes: 4 additions & 0 deletions
4
crates/swc_html_minifier/tests/fixture/attribute/html-xhtml/output.min.html
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!doctype html><title>Title of the document</title><body> | ||
The content of the document...... | ||
|
||
|
f1fd83d
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
1584492666
ns/iter (± 35554793
)1696156218
ns/iter (± 24385175
)0.93
es/full/minify/libraries/d3
393344222
ns/iter (± 37748455
)426490292
ns/iter (± 4995943
)0.92
es/full/minify/libraries/echarts
1584506875
ns/iter (± 80860645
)1662938511
ns/iter (± 21374012
)0.95
es/full/minify/libraries/jquery
86036583
ns/iter (± 4139346
)95497134
ns/iter (± 3145487
)0.90
es/full/minify/libraries/lodash
114038680
ns/iter (± 7431982
)123982745
ns/iter (± 4406934
)0.92
es/full/minify/libraries/moment
51209051
ns/iter (± 2544508
)56903321
ns/iter (± 1403173
)0.90
es/full/minify/libraries/react
17182381
ns/iter (± 1350771
)18101344
ns/iter (± 753673
)0.95
es/full/minify/libraries/terser
583996932
ns/iter (± 17009317
)610248125
ns/iter (± 11017028
)0.96
es/full/minify/libraries/three
524224565
ns/iter (± 23506625
)563355174
ns/iter (± 9674404
)0.93
es/full/minify/libraries/typescript
3380721277
ns/iter (± 64900467
)3535566146
ns/iter (± 58486143
)0.96
es/full/minify/libraries/victory
695641240
ns/iter (± 10018372
)736480185
ns/iter (± 11420624
)0.94
es/full/minify/libraries/vue
126697260
ns/iter (± 1800717
)138658248
ns/iter (± 5541045
)0.91
es/full/codegen/es3
31774
ns/iter (± 1092
)31899
ns/iter (± 648
)1.00
es/full/codegen/es5
31604
ns/iter (± 2040
)31936
ns/iter (± 897
)0.99
es/full/codegen/es2015
31525
ns/iter (± 1831
)31913
ns/iter (± 797
)0.99
es/full/codegen/es2016
31580
ns/iter (± 503
)31765
ns/iter (± 929
)0.99
es/full/codegen/es2017
31532
ns/iter (± 578
)31827
ns/iter (± 1222
)0.99
es/full/codegen/es2018
31553
ns/iter (± 784
)31925
ns/iter (± 262
)0.99
es/full/codegen/es2019
31798
ns/iter (± 810
)31684
ns/iter (± 319
)1.00
es/full/codegen/es2020
31631
ns/iter (± 846
)31745
ns/iter (± 499
)1.00
es/full/all/es3
179502933
ns/iter (± 8648296
)197162822
ns/iter (± 8611409
)0.91
es/full/all/es5
168289849
ns/iter (± 4094801
)184769269
ns/iter (± 6275160
)0.91
es/full/all/es2015
137595809
ns/iter (± 3911799
)148324397
ns/iter (± 4710346
)0.93
es/full/all/es2016
136130359
ns/iter (± 6736149
)145754236
ns/iter (± 4851550
)0.93
es/full/all/es2017
135429323
ns/iter (± 6897195
)145580932
ns/iter (± 9768233
)0.93
es/full/all/es2018
134307755
ns/iter (± 3686173
)145698219
ns/iter (± 10513463
)0.92
es/full/all/es2019
133746288
ns/iter (± 5992162
)142762470
ns/iter (± 5934614
)0.94
es/full/all/es2020
128998867
ns/iter (± 8510237
)137134191
ns/iter (± 7364653
)0.94
es/full/parser
706863
ns/iter (± 24543
)731772
ns/iter (± 13876
)0.97
es/full/base/fixer
28824
ns/iter (± 808
)29099
ns/iter (± 577
)0.99
es/full/base/resolver_and_hygiene
85100
ns/iter (± 4782
)86619
ns/iter (± 2476
)0.98
serialization of ast node
227
ns/iter (± 6
)206
ns/iter (± 5
)1.10
serialization of serde
213
ns/iter (± 6
)216
ns/iter (± 4
)0.99
This comment was automatically generated by workflow using github-action-benchmark.