@@ -93,60 +93,72 @@ Results by this library are marked with `*`.
9393The source code of the benchmark is available at ` benchmark/benchmark.ts ` .
9494
9595```
96+ Common
97+
98+ Initialization / Load speed
99+
100+ #1: html-entities x 2,986,166 ops/sec ±1.21% (85 runs sampled)
101+ #2: entities x 2,211,849 ops/sec ±1.16% (82 runs sampled)
102+ #3: he x 1,940,763 ops/sec ±1.07% (87 runs sampled)
103+
96104HTML5
97105
98106 Encode test
99107
100- * #1: html-entities.encode - html5, nonAscii x 362,978 ops/sec ±1.10% (93 runs sampled)
101- * #2: html-entities.encode - html5, nonAsciiPrintable x 343,554 ops/sec ±1.35% (93 runs sampled)
102- #3: entities.encodeHTML5 x 106,418 ops/sec ±0.41% (91 runs sampled)
103- #4: he.encode x 98,762 ops/sec ±0.93% (92 runs sampled)
108+ #1: html-entities.encode - html5, nonAscii x 436,912 ops/sec ±0.37% (95 runs sampled)
109+ #2: html-entities.encode - html5, nonAsciiPrintable x 420,014 ops/sec ±0.31% (97 runs sampled)
110+ #3: entities.encodeNonAsciiHTML x 337,400 ops/sec ±0.38% (96 runs sampled)
111+ #4: html-entities.encode - html5, extensive x 270,985 ops/sec ±0.52% (96 runs sampled)
112+ #5: entities.encodeHTML x 128,155 ops/sec ±0.33% (91 runs sampled)
113+ #6: he.encode x 115,127 ops/sec ±0.74% (93 runs sampled)
104114
105115 Decode test
106116
107- * #1: html-entities.decode - html5, strict x 291,466 ops/sec ±3.09% (86 runs sampled)
108- * #2: html-entities.decode - html5, body x 293,192 ops/sec ±5.33% (91 runs sampled)
109- * #3: html-entities.decode - html5, attribute x 272,764 ops/sec ±2.30% (91 runs sampled)
110- #4: entities.decodeHTML5 x 250,868 ops/sec ±0.59% (93 runs sampled)
111- #5: he.decode x 176,291 ops/sec ±4.48% (88 runs sampled)
117+ #1: html-entities.decode - html5, strict x 345,565 ops/sec ±0.21% (95 runs sampled)
118+ #2: entities.decodeHTMLStrict x 337,245 ops/sec ±0.59% (94 runs sampled)
119+ #3: html-entities.decode - html5, body x 333,330 ops/sec ±0.75% (96 runs sampled)
120+ #4: html-entities.decode - html5, attribute x 312,208 ops/sec ±0.31% (95 runs sampled)
121+ #5: entities.decodeHTML x 275,014 ops/sec ±0.54% (95 runs sampled)
122+ #6: he.decode x 182,385 ops/sec ±2.23% (89 runs sampled)
112123
113124HTML4
114125
115126 Encode test
116127
117- * #1: html-entities.encode - html4, nonAscii x 364,044 ops/sec ±1.70 % (92 runs sampled)
118- * #2: html-entities.encode - html4, nonAsciiPrintable x 328,646 ops/sec ±2.61 % (88 runs sampled)
119- #3: entities.encodeHTML4 x 105,841 ops/sec ±0.53 % (91 runs sampled)
128+ #1: html-entities.encode - html4, nonAscii x 407,753 ops/sec ±0.24 % (95 runs sampled)
129+ #2: html-entities.encode - html4, nonAsciiPrintable x 393,630 ops/sec ±0.42 % (96 runs sampled)
130+ #3: html- entities.encode - html4, extensive x 202,439 ops/sec ±0.23 % (95 runs sampled)
120131
121132 Decode test
122133
123- * #1: html-entities.decode - html4, body x 327,197 ops/sec ±0.76% (95 runs sampled)
124- * #2: html-entities.decode - html4, attribute x 317,243 ops/sec ±2.10% (90 runs sampled)
125- * #3: html-entities.decode - html4, strict x 312,160 ops/sec ±2.94% (83 runs sampled)
126- #4: entities.decodeHTML4 x 288,001 ops/sec ±0.85% (93 runs sampled)
134+ #1: html-entities.decode - html4, strict x 373,579 ops/sec ±0.25% (95 runs sampled)
135+ #2: html-entities.decode - html4, attribute x 365,673 ops/sec ±0.20% (96 runs sampled)
136+ #3: html-entities.decode - html4, body x 364,291 ops/sec ±2.17% (95 runs sampled)
127137
128138XML
129139
130140 Encode test
131141
132- * #1: html-entities.encode - xml, nonAscii x 427,148 ops/sec ±1.40% (94 runs sampled)
133- * #2: html-entities.encode - xml, nonAsciiPrintable x 397,820 ops/sec ±2.77% (92 runs sampled)
134- #3: entities.encodeXML x 283,177 ops/sec ±3.57% (93 runs sampled)
142+ #1: html-entities.encode - xml, nonAscii x 481,889 ops/sec ±0.43% (98 runs sampled)
143+ #2: html-entities.encode - xml, nonAsciiPrintable x 459,323 ops/sec ±0.33% (95 runs sampled)
144+ #3: entities.encodeXML x 352,201 ops/sec ±1.12% (93 runs sampled)
145+ #4: html-entities.encode - xml, extensive x 266,395 ops/sec ±0.23% (97 runs sampled)
135146
136147 Decode test
137148
138- * #1: html-entities.decode - xml, strict x 407,364 ops/sec ±0.55% (91 runs sampled)
139- #2: entities.decodeXML x 405,984 ops/sec ±0.78% (94 runs sampled)
140- * #3: html-entities.decode - xml, body x 402,167 ops/sec ±0.67% (95 runs sampled)
141- * #4: html-entities.decode - xml, attribute x 387,630 ops/sec ±2.51% (94 runs sampled)
142- #5: entities.decodeXMLStrict x 390,023 ops/sec ±7.37% (86 runs sampled)
149+ #1: html-entities.decode - xml, body x 434,407 ops/sec ±0.22% (94 runs sampled)
150+ #2: html-entities.decode - xml, strict x 430,113 ops/sec ±0.26% (95 runs sampled)
151+ #3: entities.decodeXML x 428,018 ops/sec ±0.54% (97 runs sampled)
152+ #4: html-entities.decode - xml, attribute x 426,291 ops/sec ±0.39% (95 runs sampled)
143153
144154Escaping
145155
146156 Escape test
147157
148- #1: he.escape x 1,163,620 ops/sec ±2.53% (88 runs sampled)
149- * #2: html-entities.encode - xml, specialChars x 1,087,350 ops/sec ±4.06% (91 runs sampled)
158+ #1: he.escape x 1,145,770 ops/sec ±0.24% (97 runs sampled)
159+ #2: html-entities.encode - xml, specialChars x 1,100,040 ops/sec ±1.80% (92 runs sampled)
160+ #3: entities.escapeUTF8 x 728,382 ops/sec ±0.56% (93 runs sampled)
161+ #4: entities.escape x 313,666 ops/sec ±0.27% (97 runs sampled)
150162```
151163
152164License
0 commit comments