Skip to content

Commit df70261

Browse files
authoredJan 20, 2023
fix(es/codegen): Fix codegen of string literals with \x000 (#6838)
**Related issue:** - Closes #6836.
1 parent 8194c65 commit df70261

39 files changed

+61
-51
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"jsc": {
3+
"parser": {
4+
"syntax": "ecmascript",
5+
"jsx": false
6+
},
7+
"target": "es5"
8+
},
9+
"isModule": true
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("\x000")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("\x000");
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
var USTAR = "ustar\000";
1+
var USTAR = "ustar\x0000";
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
var USTAR = "ustar\000";
1+
var USTAR = "ustar\x0000";
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
//// [scannerStringLiteralWithContainingNullCharacter1.ts]
2-
" \0 ";
2+
" \x00 ";
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
//// [templateStringControlCharacterEscapes01.ts]
2-
var x = "\0\0\0 0 00 0000";
2+
var x = "\x00\x00\x00 0 00 0000";
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
//// [unicodeExtendedEscapesInStrings01_ES5.ts]
2-
var x = "\0";
2+
var x = "\x00";
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
//// [unicodeExtendedEscapesInStrings02_ES5.ts]
2-
var x = "\0";
2+
var x = "\x00";
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
//// [unicodeExtendedEscapesInStrings03_ES5.ts]
2-
var x = "\0";
2+
var x = "\x00";
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
//// [unicodeExtendedEscapesInStrings04_ES5.ts]
2-
var x = "\0";
2+
var x = "\x00";
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
//// [unicodeExtendedEscapesInTemplates01_ES5.ts]
2-
var x = "\0";
2+
var x = "\x00";
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
//// [unicodeExtendedEscapesInTemplates02_ES5.ts]
2-
var x = "\0";
2+
var x = "\x00";
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
//// [unicodeExtendedEscapesInTemplates03_ES5.ts]
2-
var x = "\0";
2+
var x = "\x00";
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
//// [unicodeExtendedEscapesInTemplates04_ES5.ts]
2-
var x = "\0";
2+
var x = "\x00";

‎crates/swc_ecma_codegen/src/lib.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -3477,12 +3477,7 @@ fn get_quoted_utf16(v: &str, ascii_only: bool, target: EsVersion) -> String {
34773477
while let Some(c) = iter.next() {
34783478
match c {
34793479
'\x00' => {
3480-
let next = iter.peek();
3481-
3482-
match next {
3483-
Some('1'..='9') => buf.push_str("\\x00"),
3484-
_ => buf.push_str("\\0"),
3485-
}
3480+
buf.push_str("\\x00");
34863481
}
34873482
'\u{0008}' => buf.push_str("\\b"),
34883483
'\u{000c}' => buf.push_str("\\f"),

‎crates/swc_ecma_codegen/src/tests.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -591,36 +591,39 @@ CONTENT\r
591591

592592
#[test]
593593
fn test_get_quoted_utf16() {
594+
#[track_caller]
594595
fn es2020(src: &str, expected: &str) {
595596
assert_eq!(
596597
super::get_quoted_utf16(src, true, EsVersion::Es2020),
597598
expected
598599
)
599600
}
600601

602+
#[track_caller]
601603
fn es2020_nonascii(src: &str, expected: &str) {
602604
assert_eq!(
603605
super::get_quoted_utf16(src, true, EsVersion::Es2020),
604606
expected
605607
)
606608
}
607609

610+
#[track_caller]
608611
fn es5(src: &str, expected: &str) {
609612
assert_eq!(super::get_quoted_utf16(src, true, EsVersion::Es5), expected)
610613
}
611614

612615
es2020("abcde", "\"abcde\"");
613616
es2020(
614617
"\x00\r\n\u{85}\u{2028}\u{2029};",
615-
"\"\\0\\r\\n\\x85\\u2028\\u2029;\"",
618+
"\"\\x00\\r\\n\\x85\\u2028\\u2029;\"",
616619
);
617620

618621
es2020("\n", "\"\\n\"");
619622
es2020("\t", "\"\t\"");
620623

621624
es2020("'string'", "\"'string'\"");
622625

623-
es2020("\u{0}", "\"\\0\"");
626+
es2020("\u{0}", "\"\\x00\"");
624627
es2020("\u{1}", "\"\\x01\"");
625628

626629
es2020("\u{1000}", "\"\\u1000\"");
@@ -656,7 +659,7 @@ fn issue_1452_1() {
656659
fn issue_1619_1() {
657660
assert_min_target(
658661
"\"\\x00\" + \"\\x31\"",
659-
"\"\\0\"+\"1\"",
662+
"\"\\x00\"+\"1\"",
660663
EsVersion::latest(),
661664
);
662665
}
@@ -665,7 +668,7 @@ fn issue_1619_1() {
665668
fn issue_1619_2() {
666669
assert_min_target(
667670
"\"\\x00\" + \"\\x31\"",
668-
"\"\\0\"+\"1\"",
671+
"\"\\x00\"+\"1\"",
669672
EsVersion::latest(),
670673
);
671674
}

‎crates/swc_ecma_codegen/tests/fixture/string/output.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎crates/swc_ecma_codegen/tests/test262-min/0b1fc7208759253b.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"use strict";("\0");
1+
"use strict";("\x00");
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"use strict";("\0x");
1+
"use strict";("\x00x");
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"\n\r \v\b\f\\'\"\0";
1+
"\n\r \v\b\f\\'\"\x00";
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"Hello\0World";
1+
"Hello\x00World";
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
function a(){"use strict";"\0"}
1+
function a(){"use strict";"\x00"}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
("\0");
1+
("\x00");
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(function(){"use strict";"\0"}());
1+
(function(){"use strict";"\x00"}());
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
("\0");
1+
("\x00");

‎crates/swc_ecma_codegen/tests/test262/0b1fc7208759253b.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"use strict";
2-
("\0");
2+
("\x00");
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"use strict";
2-
("\0x");
2+
("\x00x");
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"\n\r \v\b\f\\'\"\0";
1+
"\n\r \v\b\f\\'\"\x00";
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"Hello\0World";
1+
"Hello\x00World";
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
function a() {
22
"use strict";
3-
"\0";
3+
"\x00";
44
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
("\0");
1+
("\x00");
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
(function() {
22
"use strict";
3-
"\0";
3+
"\x00";
44
}());
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
("\0");
1+
("\x00");

‎crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2097,7 +2097,7 @@
20972097
}
20982098
})
20992099
}) : t.push({
2100-
string: s.replace(i, "\0"),
2100+
string: s.replace(i, "\x00"),
21012101
attributes: n.attributes
21022102
}), o = a + u.length;
21032103
}

‎crates/swc_ecma_minifier/tests/terser/compress/object/property_with_unprintable/output.mangleOnly.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var r = {
1+
var x = {
22
"\0": "foo",
33
get "\0" () {
44
return "bar";
@@ -10,12 +10,12 @@ var r = {
1010
return "foobar";
1111
}
1212
};
13-
class e {
13+
class r {
1414
get "\0"() {
1515
return "bar";
1616
}
17-
set "\0"(r) {
18-
save(r);
17+
set "\0"(x) {
18+
save(x);
1919
}
2020
*"\0"() {
2121
return "foobar";

‎crates/swc_ecma_minifier/tests/terser/compress/object/property_with_unprintable_ascii_only/output.mangleOnly.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var r = {
1+
var x = {
22
"\0\x01": "foo",
33
get "\0\x01" () {
44
return "bar";
@@ -10,12 +10,12 @@ var r = {
1010
return "foobar";
1111
}
1212
};
13-
class e {
13+
class r {
1414
get "\0\x01"() {
1515
return "bar";
1616
}
17-
set "\0\x01"(r) {
18-
save(r);
17+
set "\0\x01"(x) {
18+
save(x);
1919
}
2020
*"\0\x01"() {
2121
return "foobar";

2 commit comments

Comments
 (2)

github-actions[bot] commented on Jan 20, 2023

@github-actions[bot]

Benchmark

Benchmark suite Current: df70261 Previous: 7205543 Ratio
es/full/bugs-1 339282 ns/iter (± 8018) 302634 ns/iter (± 8619) 1.12
es/full/minify/libraries/antd 2020477325 ns/iter (± 37312656) 1754528121 ns/iter (± 20609853) 1.15
es/full/minify/libraries/d3 408036083 ns/iter (± 1165623) 317509454 ns/iter (± 5436491) 1.29
es/full/minify/libraries/echarts 1555690067 ns/iter (± 9638350) 1349861197 ns/iter (± 23075484) 1.15
es/full/minify/libraries/jquery 119423066 ns/iter (± 1023538) 92949255 ns/iter (± 667750) 1.28
es/full/minify/libraries/lodash 145943427 ns/iter (± 831741) 108655873 ns/iter (± 1171897) 1.34
es/full/minify/libraries/moment 67844594 ns/iter (± 217788) 53763340 ns/iter (± 277242) 1.26
es/full/minify/libraries/react 23593746 ns/iter (± 107448) 19270692 ns/iter (± 91515) 1.22
es/full/minify/libraries/terser 349483138 ns/iter (± 1538007) 261976546 ns/iter (± 5032591) 1.33
es/full/minify/libraries/three 595905515 ns/iter (± 2954925) 475651033 ns/iter (± 4843971) 1.25
es/full/minify/libraries/typescript 3754358610 ns/iter (± 18213841) 3288143634 ns/iter (± 12082398) 1.14
es/full/minify/libraries/victory 888378373 ns/iter (± 3318067) 728694218 ns/iter (± 12123083) 1.22
es/full/minify/libraries/vue 180432788 ns/iter (± 800815) 136331664 ns/iter (± 1276179) 1.32
es/full/codegen/es3 26546 ns/iter (± 73) 25832 ns/iter (± 57) 1.03
es/full/codegen/es5 26512 ns/iter (± 103) 25964 ns/iter (± 42) 1.02
es/full/codegen/es2015 26496 ns/iter (± 74) 25948 ns/iter (± 50) 1.02
es/full/codegen/es2016 26535 ns/iter (± 54) 25898 ns/iter (± 49) 1.02
es/full/codegen/es2017 26517 ns/iter (± 71) 25967 ns/iter (± 61) 1.02
es/full/codegen/es2018 26497 ns/iter (± 89) 25973 ns/iter (± 67) 1.02
es/full/codegen/es2019 26517 ns/iter (± 57) 25934 ns/iter (± 61) 1.02
es/full/codegen/es2020 26505 ns/iter (± 33) 25909 ns/iter (± 62) 1.02
es/full/all/es3 213075312 ns/iter (± 2728595) 171684783 ns/iter (± 2021376) 1.24
es/full/all/es5 200966179 ns/iter (± 2875251) 163767287 ns/iter (± 1625223) 1.23
es/full/all/es2015 153199390 ns/iter (± 4611003) 125012378 ns/iter (± 947613) 1.23
es/full/all/es2016 149830360 ns/iter (± 4014678) 123165227 ns/iter (± 1599892) 1.22
es/full/all/es2017 150880749 ns/iter (± 1592249) 121569292 ns/iter (± 977079) 1.24
es/full/all/es2018 145639875 ns/iter (± 3310719) 120230844 ns/iter (± 992277) 1.21
es/full/all/es2019 146939510 ns/iter (± 3953142) 119695917 ns/iter (± 648927) 1.23
es/full/all/es2020 143195256 ns/iter (± 1369687) 115082124 ns/iter (± 1073100) 1.24
es/full/parser 562165 ns/iter (± 12273) 540707 ns/iter (± 7750) 1.04
es/full/base/fixer 22476 ns/iter (± 28) 21983 ns/iter (± 28) 1.02
es/full/base/resolver_and_hygiene 81697 ns/iter (± 124) 80445 ns/iter (± 99) 1.02
serialization of ast node 144 ns/iter (± 0) 145 ns/iter (± 0) 0.99
serialization of serde 130 ns/iter (± 0) 130 ns/iter (± 0) 1
css/minify/libraries/bootstrap 31211511 ns/iter (± 54489) 28177951 ns/iter (± 218528) 1.11
css/visitor/compare/clone 2831296 ns/iter (± 43978) 2065755 ns/iter (± 11081) 1.37
css/visitor/compare/visit_mut_span 3116884 ns/iter (± 117362) 2269054 ns/iter (± 10056) 1.37
css/visitor/compare/visit_mut_span_panic 3180155 ns/iter (± 29682) 2295705 ns/iter (± 6335) 1.39
css/visitor/compare/fold_span 4112294 ns/iter (± 39689) 3027146 ns/iter (± 20067) 1.36
css/visitor/compare/fold_span_panic 4398536 ns/iter (± 37289) 3157622 ns/iter (± 21556) 1.39
css/lexer/bootstrap_5_1_3 5279512 ns/iter (± 23948) 5175245 ns/iter (± 5952) 1.02
css/lexer/foundation_6_7_4 4429625 ns/iter (± 1709) 4357196 ns/iter (± 5811) 1.02
css/lexer/tailwind_3_1_1 841555 ns/iter (± 428) 828691 ns/iter (± 679) 1.02
css/parser/bootstrap_5_1_3 23605003 ns/iter (± 90626) 21778097 ns/iter (± 72964) 1.08
css/parser/foundation_6_7_4 18845985 ns/iter (± 30180) 17325116 ns/iter (± 43512) 1.09
css/parser/tailwind_3_1_1 3504408 ns/iter (± 9501) 3318949 ns/iter (± 8935) 1.06
es/codegen/colors 295615 ns/iter (± 164367) 330332 ns/iter (± 185627) 0.89
es/codegen/large 2639905 ns/iter (± 1576748) 1207674 ns/iter (± 610211) 2.19
es/codegen/with-parser/colors 49267 ns/iter (± 398) 48584 ns/iter (± 340) 1.01
es/codegen/with-parser/large 550787 ns/iter (± 2638) 538624 ns/iter (± 1614) 1.02
es/minify/libraries/antd 1738898711 ns/iter (± 8372492) 1564080477 ns/iter (± 15817706) 1.11
es/minify/libraries/d3 356805535 ns/iter (± 1261172) 265477364 ns/iter (± 4974840) 1.34
es/minify/libraries/echarts 1329064999 ns/iter (± 4240455) 1156348746 ns/iter (± 20610931) 1.15
es/minify/libraries/jquery 104204016 ns/iter (± 762625) 80367619 ns/iter (± 1979696) 1.30
es/minify/libraries/lodash 132114933 ns/iter (± 646381) 97211452 ns/iter (± 1147846) 1.36
es/minify/libraries/moment 59760120 ns/iter (± 421550) 46635963 ns/iter (± 320520) 1.28
es/minify/libraries/react 21044437 ns/iter (± 118979) 17304098 ns/iter (± 138864) 1.22
es/minify/libraries/terser 305672597 ns/iter (± 1487312) 219568020 ns/iter (± 2864092) 1.39
es/minify/libraries/three 508687686 ns/iter (± 2594831) 400563343 ns/iter (± 5302651) 1.27
es/minify/libraries/typescript 3164789738 ns/iter (± 15786120) 2818357970 ns/iter (± 10428453) 1.12
es/minify/libraries/victory 765997255 ns/iter (± 2400987) 623439027 ns/iter (± 11808582) 1.23
es/minify/libraries/vue 163945563 ns/iter (± 502171) 119190579 ns/iter (± 1028200) 1.38
es/visitor/compare/clone 3524587 ns/iter (± 75907) 2401622 ns/iter (± 21369) 1.47
es/visitor/compare/visit_mut_span 4191984 ns/iter (± 24937) 2836177 ns/iter (± 23919) 1.48
es/visitor/compare/visit_mut_span_panic 4314549 ns/iter (± 43772) 2876571 ns/iter (± 6925) 1.50
es/visitor/compare/fold_span 5716645 ns/iter (± 41340) 3988756 ns/iter (± 8412) 1.43
es/visitor/compare/fold_span_panic 5920366 ns/iter (± 48325) 4142528 ns/iter (± 42542) 1.43
es/lexer/colors 17422 ns/iter (± 13) 17256 ns/iter (± 27) 1.01
es/lexer/angular 8493460 ns/iter (± 2803) 8243000 ns/iter (± 7827) 1.03
es/lexer/backbone 1098345 ns/iter (± 296) 1079670 ns/iter (± 1028) 1.02
es/lexer/jquery 6141959 ns/iter (± 3741) 5975874 ns/iter (± 4806) 1.03
es/lexer/jquery mobile 9480067 ns/iter (± 14278) 9215885 ns/iter (± 14610) 1.03
es/lexer/mootools 4793144 ns/iter (± 3980) 4671164 ns/iter (± 8371) 1.03
es/lexer/underscore 915077 ns/iter (± 668) 902164 ns/iter (± 701) 1.01
es/lexer/three 29066778 ns/iter (± 38153) 27981921 ns/iter (± 29171) 1.04
es/lexer/yui 5202216 ns/iter (± 4940) 5057211 ns/iter (± 3719) 1.03
es/parser/colors 31618 ns/iter (± 194) 31103 ns/iter (± 143) 1.02
es/parser/angular 18348952 ns/iter (± 300705) 15960990 ns/iter (± 99508) 1.15
es/parser/backbone 2555008 ns/iter (± 36044) 2350329 ns/iter (± 11844) 1.09
es/parser/jquery 15166291 ns/iter (± 258412) 12755482 ns/iter (± 79498) 1.19
es/parser/jquery mobile 24250182 ns/iter (± 312469) 20372702 ns/iter (± 154401) 1.19
es/parser/mootools 11340707 ns/iter (± 91892) 9807389 ns/iter (± 18506) 1.16
es/parser/underscore 2124839 ns/iter (± 23340) 2003962 ns/iter (± 11382) 1.06
es/parser/three 66875152 ns/iter (± 189396) 61494059 ns/iter (± 367939) 1.09
es/parser/yui 11452494 ns/iter (± 178461) 9703996 ns/iter (± 54095) 1.18
es/preset-env/usage/builtin_type 140525 ns/iter (± 30593) 143208 ns/iter (± 33022) 0.98
es/preset-env/usage/property 21661 ns/iter (± 96) 21389 ns/iter (± 93) 1.01
es/resolver/typescript 129391817 ns/iter (± 3884900) 123923196 ns/iter (± 4503446) 1.04
es/fixer/typescript 102303732 ns/iter (± 1340748) 99521875 ns/iter (± 3141329) 1.03
es/hygiene/typescript 223311361 ns/iter (± 1916017) 205517957 ns/iter (± 1315763) 1.09
es/resolver_with_hygiene/typescript 384079584 ns/iter (± 3034791) 351056834 ns/iter (± 1996718) 1.09
es/visitor/base-perf/module_clone 76603 ns/iter (± 770) 75209 ns/iter (± 1470) 1.02
es/visitor/base-perf/fold_empty 87055 ns/iter (± 1185) 85148 ns/iter (± 1548) 1.02
es/visitor/base-perf/fold_noop_impl_all 86975 ns/iter (± 1772) 84891 ns/iter (± 391) 1.02
es/visitor/base-perf/fold_noop_impl_vec 87243 ns/iter (± 1349) 85646 ns/iter (± 1262) 1.02
es/visitor/base-perf/boxing_boxed_clone 56 ns/iter (± 0) 56 ns/iter (± 0) 1
es/visitor/base-perf/boxing_unboxed_clone 59 ns/iter (± 0) 59 ns/iter (± 0) 1
es/visitor/base-perf/boxing_boxed 104 ns/iter (± 0) 104 ns/iter (± 0) 1
es/visitor/base-perf/boxing_unboxed 103 ns/iter (± 0) 103 ns/iter (± 0) 1
es/visitor/base-perf/visit_contains_this 3508 ns/iter (± 68) 3436 ns/iter (± 101) 1.02
es/base/parallel/resolver/typescript 5649126209 ns/iter (± 234143046) 5901165347 ns/iter (± 546858764) 0.96
es/base/parallel/hygiene/typescript 2744067109 ns/iter (± 38748395) 2395657128 ns/iter (± 36414499) 1.15
misc/visitors/time-complexity/time 5 93 ns/iter (± 0) 93 ns/iter (± 0) 1
misc/visitors/time-complexity/time 10 339 ns/iter (± 0) 342 ns/iter (± 0) 0.99
misc/visitors/time-complexity/time 15 627 ns/iter (± 3) 636 ns/iter (± 0) 0.99
misc/visitors/time-complexity/time 20 1173 ns/iter (± 5) 1163 ns/iter (± 0) 1.01
misc/visitors/time-complexity/time 40 6223 ns/iter (± 41) 6090 ns/iter (± 30) 1.02
misc/visitors/time-complexity/time 60 15570 ns/iter (± 21) 15700 ns/iter (± 285) 0.99
es/full-target/es2016 193827 ns/iter (± 245) 188489 ns/iter (± 580) 1.03
es/full-target/es2017 188382 ns/iter (± 635) 183122 ns/iter (± 584) 1.03
es/full-target/es2018 177309 ns/iter (± 325) 172313 ns/iter (± 282) 1.03
es2020_nullish_coalescing 68644 ns/iter (± 6880) 67233 ns/iter (± 104) 1.02
es2020_optional_chaining 98803 ns/iter (± 9072) 96433 ns/iter (± 284) 1.02
es2022_class_properties 96001 ns/iter (± 121) 94083 ns/iter (± 258) 1.02
es2018_object_rest_spread 73098 ns/iter (± 144) 70979 ns/iter (± 129) 1.03
es2019_optional_catch_binding 62815 ns/iter (± 94) 61310 ns/iter (± 136) 1.02
es2017_async_to_generator 63158 ns/iter (± 116) 61725 ns/iter (± 83) 1.02
es2016_exponentiation 66849 ns/iter (± 234) 64937 ns/iter (± 134) 1.03
es2015_arrow 71882 ns/iter (± 293) 69863 ns/iter (± 240) 1.03
es2015_block_scoped_fn 67663 ns/iter (± 91) 66145 ns/iter (± 140) 1.02
es2015_block_scoping 151335 ns/iter (± 8766) 153742 ns/iter (± 8913) 0.98
es2015_classes 120874 ns/iter (± 573) 116983 ns/iter (± 468) 1.03
es2015_computed_props 62685 ns/iter (± 51) 61347 ns/iter (± 110) 1.02
es2015_destructuring 118788 ns/iter (± 515) 116500 ns/iter (± 137) 1.02
es2015_duplicate_keys 65104 ns/iter (± 143) 63941 ns/iter (± 99) 1.02
es2015_parameters 81635 ns/iter (± 149) 78420 ns/iter (± 245) 1.04
es2015_fn_name 69650 ns/iter (± 708) 65404 ns/iter (± 540) 1.06
es2015_for_of 65715 ns/iter (± 127) 63086 ns/iter (± 118) 1.04
es2015_instanceof 64936 ns/iter (± 104) 62021 ns/iter (± 136) 1.05
es2015_shorthand_property 62680 ns/iter (± 103) 59811 ns/iter (± 78) 1.05
es2015_spread 62559 ns/iter (± 106) 59959 ns/iter (± 119) 1.04
es2015_sticky_regex 63830 ns/iter (± 126) 61104 ns/iter (± 156) 1.04
es2015_typeof_symbol 63894 ns/iter (± 56) 61041 ns/iter (± 68) 1.05
es/transform/baseline/base 53160 ns/iter (± 128) 51089 ns/iter (± 78) 1.04
es/transform/baseline/common_reserved_word 64179 ns/iter (± 119) 61633 ns/iter (± 99) 1.04
es/transform/baseline/common_typescript 148362 ns/iter (± 5338) 166067 ns/iter (± 227) 0.89
es/target/es3 174779 ns/iter (± 239) 166280 ns/iter (± 284) 1.05
es/target/es2015 648038 ns/iter (± 2160) 601338 ns/iter (± 834) 1.08
es/target/es2016 66874 ns/iter (± 136) 63799 ns/iter (± 75) 1.05
es/target/es2017 63313 ns/iter (± 96) 60618 ns/iter (± 98) 1.04
es/target/es2018 83372 ns/iter (± 130) 79348 ns/iter (± 116) 1.05
es/target/es2020 136903 ns/iter (± 457) 128964 ns/iter (± 203) 1.06
babelify-only 691914 ns/iter (± 1743) 676955 ns/iter (± 1315) 1.02
parse_and_babelify_angular 50893768 ns/iter (± 821073) 46564210 ns/iter (± 901781) 1.09
parse_and_babelify_backbone 7424410 ns/iter (± 123087) 5510762 ns/iter (± 48300) 1.35
parse_and_babelify_jquery 40122368 ns/iter (± 484303) 33248887 ns/iter (± 386200) 1.21
parse_and_babelify_jquery_mobile 66018280 ns/iter (± 743545) 56710953 ns/iter (± 809178) 1.16
parse_and_babelify_mootools 40444998 ns/iter (± 293203) 34998815 ns/iter (± 687549) 1.16
parse_and_babelify_underscore 5850222 ns/iter (± 58718) 4376321 ns/iter (± 17560) 1.34
parse_and_babelify_yui 39801319 ns/iter (± 739701) 34638031 ns/iter (± 872522) 1.15
html/minify/document/css_spec 50427530 ns/iter (± 144405) 42715190 ns/iter (± 347109) 1.18
html/minify/document/github 20044877 ns/iter (± 31471) 17669451 ns/iter (± 96094) 1.13
html/minify/document/stackoverflow 18248549 ns/iter (± 31553) 15749019 ns/iter (± 55175) 1.16
html/minify/document_fragment/css_spec 48600471 ns/iter (± 78824) 41114566 ns/iter (± 333235) 1.18
html/minify/document_fragment/github 19218918 ns/iter (± 55783) 16950737 ns/iter (± 51305) 1.13
html/minify/document_fragment/stackoverflow 17653700 ns/iter (± 19435) 15400279 ns/iter (± 93899) 1.15
html/document/visitor/compare/clone 353520 ns/iter (± 1356) 340936 ns/iter (± 1986) 1.04
html/document/visitor/compare/visit_mut_span 374856 ns/iter (± 2405) 367018 ns/iter (± 2152) 1.02
html/document/visitor/compare/visit_mut_span_panic 385232 ns/iter (± 1886) 376662 ns/iter (± 1551) 1.02
html/document/visitor/compare/fold_span 414385 ns/iter (± 1723) 407205 ns/iter (± 2440) 1.02
html/document/visitor/compare/fold_span_panic 472884 ns/iter (± 2672) 460949 ns/iter (± 2343) 1.03
html/document_fragment/visitor/compare/clone 347196 ns/iter (± 1604) 345647 ns/iter (± 1828) 1.00
html/document_fragment/visitor/compare/visit_mut_span 376288 ns/iter (± 2483) 366156 ns/iter (± 1719) 1.03
html/document_fragment/visitor/compare/visit_mut_span_panic 383711 ns/iter (± 1844) 381774 ns/iter (± 2245) 1.01
html/document_fragment/visitor/compare/fold_span 413489 ns/iter (± 2047) 410284 ns/iter (± 1907) 1.01
html/document_fragment/visitor/compare/fold_span_panic 472181 ns/iter (± 2704) 460944 ns/iter (± 2151) 1.02
html/lexer/css_2021_spec 16014388 ns/iter (± 27810) 15648082 ns/iter (± 16491) 1.02
html/lexer/github_com_17_05_2022 6195054 ns/iter (± 9014) 6043261 ns/iter (± 8689) 1.03
html/lexer/stackoverflow_com_17_05_2022 5808371 ns/iter (± 7131) 5647912 ns/iter (± 4161) 1.03
html/parser/parser_document/css_2021_spec 30030188 ns/iter (± 254389) 25698606 ns/iter (± 152043) 1.17
html/parser/parser_document/github_com_17_05_2022 9779462 ns/iter (± 21948) 8806054 ns/iter (± 11876) 1.11
html/parser/parser_document/stackoverflow_com_17_05_2022 8392478 ns/iter (± 10976) 7755110 ns/iter (± 4269) 1.08
html/parser/parser_document_fragment/css_2021_spec 30473655 ns/iter (± 67026) 26339904 ns/iter (± 275850) 1.16
html/parser/parser_document_fragment/github_com_17_05_2022 9803043 ns/iter (± 48108) 8832667 ns/iter (± 15592) 1.11
html/parser/parser_document_fragment/stackoverflow_com_17_05_2022 8373841 ns/iter (± 10085) 7790507 ns/iter (± 4385) 1.07

This comment was automatically generated by workflow using github-action-benchmark.

github-actions[bot] commented on Jan 20, 2023

@github-actions[bot]

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: df70261 Previous: 7205543 Ratio
es/codegen/large 2639905 ns/iter (± 1576748) 1207674 ns/iter (± 610211) 2.19

This comment was automatically generated by workflow using github-action-benchmark.

CC: @kdy1

Please sign in to comment.