-
-
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(html/minifier): Compress more svg/mathml attributes (#5001)
- Loading branch information
1 parent
631b32f
commit 1538649
Showing
14 changed files
with
272 additions
and
14 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
28 changes: 28 additions & 0 deletions
28
crates/swc_html_minifier/tests/fixture/element/math/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,28 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<math xmlns="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<mrow> | ||
<mrow> | ||
<msup> | ||
<mi>a</mi> | ||
<mn>2</mn> | ||
</msup> | ||
<mo>+</mo> | ||
<msup> | ||
<mi>b</mi> | ||
<mn>2</mn> | ||
</msup> | ||
</mrow> | ||
<mo>=</mo> | ||
<msup> | ||
<mi>c</mi> | ||
<mn>2</mn> | ||
</msup> | ||
</mrow> | ||
</math> | ||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
crates/swc_html_minifier/tests/fixture/element/math/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,22 @@ | ||
<!doctype html><html lang=en><title>Document</title><body> | ||
<math> | ||
<mrow> | ||
<mrow> | ||
<msup> | ||
<mi>a</mi> | ||
<mn>2</mn> | ||
</msup> | ||
<mo>+</mo> | ||
<msup> | ||
<mi>b</mi> | ||
<mn>2</mn> | ||
</msup> | ||
</mrow> | ||
<mo>=</mo> | ||
<msup> | ||
<mi>c</mi> | ||
<mn>2</mn> | ||
</msup> | ||
</mrow> | ||
</math> | ||
|
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
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
Oops, something went wrong.
1538649
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
1720195478
ns/iter (± 78626837
)1727175888
ns/iter (± 49345255
)1.00
es/full/minify/libraries/d3
429809414
ns/iter (± 19706331
)445457009
ns/iter (± 14736128
)0.96
es/full/minify/libraries/echarts
1660009543
ns/iter (± 81266227
)1731416313
ns/iter (± 42010245
)0.96
es/full/minify/libraries/jquery
101747628
ns/iter (± 6711505
)91864461
ns/iter (± 5247837
)1.11
es/full/minify/libraries/lodash
131590038
ns/iter (± 8780137
)119936854
ns/iter (± 8063044
)1.10
es/full/minify/libraries/moment
57121137
ns/iter (± 1991125
)54363705
ns/iter (± 2911850
)1.05
es/full/minify/libraries/react
18692602
ns/iter (± 376536
)17825109
ns/iter (± 494111
)1.05
es/full/minify/libraries/terser
626017699
ns/iter (± 15191980
)613642144
ns/iter (± 17073712
)1.02
es/full/minify/libraries/three
574387771
ns/iter (± 21485777
)570527363
ns/iter (± 15544673
)1.01
es/full/minify/libraries/typescript
3748189386
ns/iter (± 122781814
)3567409937
ns/iter (± 87977391
)1.05
es/full/minify/libraries/victory
764356001
ns/iter (± 40938727
)751522801
ns/iter (± 6781704
)1.02
es/full/minify/libraries/vue
171156402
ns/iter (± 9823572
)146967034
ns/iter (± 5001953
)1.16
es/full/codegen/es3
31791
ns/iter (± 1183
)32023
ns/iter (± 1106
)0.99
es/full/codegen/es5
31690
ns/iter (± 356
)32061
ns/iter (± 483
)0.99
es/full/codegen/es2015
31691
ns/iter (± 2381
)31949
ns/iter (± 263
)0.99
es/full/codegen/es2016
32081
ns/iter (± 1021
)31597
ns/iter (± 630
)1.02
es/full/codegen/es2017
32042
ns/iter (± 1518
)31305
ns/iter (± 540
)1.02
es/full/codegen/es2018
32268
ns/iter (± 4402
)31293
ns/iter (± 791
)1.03
es/full/codegen/es2019
32386
ns/iter (± 1235
)31390
ns/iter (± 900
)1.03
es/full/codegen/es2020
32132
ns/iter (± 1691
)31303
ns/iter (± 1242
)1.03
es/full/all/es3
202924096
ns/iter (± 15252997
)182243196
ns/iter (± 4271063
)1.11
es/full/all/es5
191503422
ns/iter (± 13423603
)170791250
ns/iter (± 3226003
)1.12
es/full/all/es2015
154483214
ns/iter (± 11451057
)139674472
ns/iter (± 3682959
)1.11
es/full/all/es2016
151577135
ns/iter (± 9821706
)138646305
ns/iter (± 3102989
)1.09
es/full/all/es2017
152282901
ns/iter (± 10003184
)138079304
ns/iter (± 3251590
)1.10
es/full/all/es2018
147270296
ns/iter (± 9104486
)136594507
ns/iter (± 3142364
)1.08
es/full/all/es2019
147783129
ns/iter (± 9754781
)135875461
ns/iter (± 3571986
)1.09
es/full/all/es2020
140488533
ns/iter (± 6798396
)131290040
ns/iter (± 3449335
)1.07
es/full/parser
719978
ns/iter (± 31589
)702072
ns/iter (± 26429
)1.03
es/full/base/fixer
30015
ns/iter (± 5310
)29316
ns/iter (± 398
)1.02
es/full/base/resolver_and_hygiene
87799
ns/iter (± 33946
)86352
ns/iter (± 1366
)1.02
serialization of ast node
206
ns/iter (± 6
)208
ns/iter (± 4
)0.99
serialization of serde
219
ns/iter (± 16
)216
ns/iter (± 5
)1.01
This comment was automatically generated by workflow using github-action-benchmark.