Skip to content

Commit

Permalink
feat(es/renamer): Rename synthesized identifiers even on eval (#6818)
Browse files Browse the repository at this point in the history
**Related issue:**

 - Closes #5068.
  • Loading branch information
kdy1 authored Jan 16, 2023
1 parent a5707ae commit 82bd5c2
Show file tree
Hide file tree
Showing 15 changed files with 253 additions and 36 deletions.
88 changes: 77 additions & 11 deletions crates/swc/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use swc_common::{
util::take::Take,
FileName, Mark, SourceMap,
};
use swc_ecma_ast::{EsVersion, Module};
use swc_ecma_ast::{EsVersion, Module, Script};
use swc_ecma_minifier::option::{terser::TerserTopLevelOptions, MinifyOptions};
use swc_ecma_parser::Syntax;
use swc_ecma_transforms::{
Expand Down Expand Up @@ -351,11 +351,13 @@ impl<'a, 'b, P: swc_ecma_visit::Fold> PassBuilder<'a, 'b, P> {
options: self.minify,
cm: self.cm.clone(),
comments: comments.cloned(),
unresolved_mark: self.unresolved_mark,
top_level_mark: self.top_level_mark,
}),
Optional::new(
hygiene_with_config(self.hygiene.clone().unwrap_or_default()),
hygiene_with_config(swc_ecma_transforms_base::hygiene::Config {
top_level_mark: self.top_level_mark,
..self.hygiene.clone().unwrap_or_default()
}),
self.hygiene.is_some() && !is_mangler_enabled
),
Optional::new(fixer(comments.map(|v| v as &dyn Comments)), self.fixer),
Expand All @@ -367,7 +369,6 @@ struct MinifierPass {
options: Option<JsMinifyOptions>,
cm: Lrc<SourceMap>,
comments: Option<SingleThreadedComments>,
unresolved_mark: Mark,
top_level_mark: Mark,
}

Expand Down Expand Up @@ -408,13 +409,18 @@ impl VisitMut for MinifierPass {
return;
}

m.visit_mut_with(&mut hygiene());
m.visit_mut_with(&mut resolver(
self.unresolved_mark,
self.top_level_mark,
false,
m.visit_mut_with(&mut hygiene_with_config(
swc_ecma_transforms_base::hygiene::Config {
top_level_mark: self.top_level_mark,
..Default::default()
},
));

let unresolved_mark = Mark::new();
let top_level_mark = Mark::new();

m.visit_mut_with(&mut resolver(unresolved_mark, top_level_mark, false));

m.map_with_mut(|m| {
swc_ecma_minifier::optimize(
m.into(),
Expand All @@ -423,14 +429,74 @@ impl VisitMut for MinifierPass {
None,
&opts,
&swc_ecma_minifier::option::ExtraOptions {
unresolved_mark: self.unresolved_mark,
top_level_mark: self.top_level_mark,
unresolved_mark,
top_level_mark,
},
)
.expect_module()
})
}
}

fn visit_mut_script(&mut self, m: &mut Script) {
if let Some(options) = &self.options {
let opts = MinifyOptions {
compress: options
.compress
.clone()
.unwrap_as_option(|default| match default {
Some(true) => Some(Default::default()),
_ => None,
})
.map(|mut v| {
if v.const_to_let.is_none() {
v.const_to_let = Some(true);
}

v.into_config(self.cm.clone())
}),
mangle: options
.mangle
.clone()
.unwrap_as_option(|default| match default {
Some(true) => Some(Default::default()),
_ => None,
}),
..Default::default()
};

if opts.compress.is_none() && opts.mangle.is_none() {
return;
}

m.visit_mut_with(&mut hygiene_with_config(
swc_ecma_transforms_base::hygiene::Config {
top_level_mark: self.top_level_mark,
..Default::default()
},
));

let unresolved_mark = Mark::new();
let top_level_mark = Mark::new();

m.visit_mut_with(&mut resolver(unresolved_mark, top_level_mark, false));

m.map_with_mut(|m| {
swc_ecma_minifier::optimize(
m.into(),
self.cm.clone(),
self.comments.as_ref().map(|v| v as &dyn Comments),
None,
&opts,
&swc_ecma_minifier::option::ExtraOptions {
unresolved_mark,
top_level_mark,
},
)
.expect_script()
})
}
}
}

fn should_enable(target: EsVersion, feature: EsVersion) -> bool {
Expand Down
19 changes: 19 additions & 0 deletions crates/swc/tests/fixture/issues-5xxx/5068/1/input/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true
},
"target": "es5",
"loose": false,
"minify": {
"compress": false,
"mangle": false
}
},
"module": {
"type": "es6"
},
"minify": false,
"isModule": true
}
11 changes: 11 additions & 0 deletions crates/swc/tests/fixture/issues-5xxx/5068/1/input/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import styled from 'styled-components';

const C1 = styled.div`
position: absolute;
`;

const C2 = styled.div`
position: absolute;
`;

const debug = eval('');
23 changes: 23 additions & 0 deletions crates/swc/tests/fixture/issues-5xxx/5068/1/output/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import _tagged_template_literal from "@swc/helpers/src/_tagged_template_literal.mjs";
function _templateObject() {
var data = _tagged_template_literal([
"\n position: absolute;\n"
]);
_templateObject = function _templateObject() {
return data;
};
return data;
}
function _templateObject1() {
var data = _tagged_template_literal([
"\n position: absolute;\n"
]);
_templateObject1 = function _templateObject1() {
return data;
};
return data;
}
import styled from "styled-components";
var C1 = styled.div(_templateObject());
var C2 = styled.div(_templateObject1());
var debug = eval("");
19 changes: 19 additions & 0 deletions crates/swc/tests/fixture/issues-5xxx/5068/2/input/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true
},
"target": "es5",
"loose": false,
"minify": {
"compress": false,
"mangle": true
}
},
"module": {
"type": "es6"
},
"minify": false,
"isModule": true
}
11 changes: 11 additions & 0 deletions crates/swc/tests/fixture/issues-5xxx/5068/2/input/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import styled from 'styled-components';

const C1 = styled.div`
position: absolute;
`;

const C2 = styled.div`
position: absolute;
`;

const debug = eval('');
23 changes: 23 additions & 0 deletions crates/swc/tests/fixture/issues-5xxx/5068/2/output/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import _tagged_template_literal from "@swc/helpers/src/_tagged_template_literal.mjs";
function _templateObject() {
var n = _tagged_template_literal([
"\n position: absolute;\n"
]);
_templateObject = function r() {
return n;
};
return n;
}
function _templateObject1() {
var n = _tagged_template_literal([
"\n position: absolute;\n"
]);
_templateObject1 = function r() {
return n;
};
return n;
}
import styled from "styled-components";
var C1 = styled.div(_templateObject());
var C2 = styled.div(_templateObject1());
var debug = eval("");
7 changes: 6 additions & 1 deletion crates/swc_ecma_minifier/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,12 @@ pub fn optimize(
)
.compile();

n.visit_mut_with(&mut name_mangler(mangle.clone(), preserved, chars));
n.visit_mut_with(&mut name_mangler(
mangle.clone(),
preserved,
chars,
extra.top_level_mark,
));

if let Some(property_mangle_options) = &mangle.props {
mangle_properties(&mut n, &module_info, property_mangle_options.clone(), chars);
Expand Down
4 changes: 3 additions & 1 deletion crates/swc_ecma_minifier/src/pass/mangle_names/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rustc_hash::{FxHashMap, FxHashSet};
use swc_atoms::JsWord;
use swc_common::chain;
use swc_common::{chain, Mark};
use swc_ecma_ast::{Module, *};
use swc_ecma_transforms_base::rename::{renamer, Renamer};
use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith};
Expand All @@ -15,6 +15,7 @@ pub(crate) fn name_mangler(
options: MangleOptions,
preserved: FxHashSet<Id>,
chars: Base54Chars,
top_level_mark: Mark,
) -> impl VisitMut {
chain!(
LabelMangler {
Expand All @@ -27,6 +28,7 @@ pub(crate) fn name_mangler(
swc_ecma_transforms_base::hygiene::Config {
keep_class_names: options.keep_class_names,
safari_10: options.safari10,
top_level_mark
},
ManglingRenamer { chars, preserved }
)
Expand Down
6 changes: 5 additions & 1 deletion crates/swc_ecma_transforms_base/src/hygiene/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use swc_common::chain;
use swc_common::{chain, Mark};
use swc_ecma_ast::*;
use swc_ecma_visit::{as_folder, noop_visit_mut_type, Fold, VisitMut};

Expand All @@ -15,6 +15,10 @@ pub struct Config {

/// If true, the bug of safari 10 is avoided.
pub safari_10: bool,

/// The marks derived from this marks will treated as `specified by user`
/// and other marks will be treated as `generated by swc`.
pub top_level_mark: Mark,
}

/// See [hygiene_with_config] for doc. Creates a `hygiene` pass with default
Expand Down
18 changes: 13 additions & 5 deletions crates/swc_ecma_transforms_base/src/rename/analyzer/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use swc_common::Mark;
use swc_ecma_ast::*;
use swc_ecma_visit::{noop_visit_type, Visit, VisitWith};

Expand All @@ -9,6 +10,11 @@ pub(super) mod scope;
#[derive(Debug, Default)]
pub(super) struct Analyzer {
pub safari_10: bool,
/// If `eval` exists for the current scope, we only rename synthesized
/// identifiers.
pub has_eval: bool,
/// The [Mark] which is parent of user-specified identifiers.
pub top_level_mark: Mark,

pub is_pat_decl: bool,
pub var_belong_to_fn_scope: bool,
Expand All @@ -25,12 +31,12 @@ impl Analyzer {
if belong_to_fn_scope {
match self.scope.kind {
ScopeKind::Fn => {
self.scope.add_decl(&id);
self.scope.add_decl(&id, self.has_eval, self.top_level_mark);
}
ScopeKind::Block => self.hoisted_vars.push(id),
}
} else {
self.scope.add_decl(&id);
self.scope.add_decl(&id, self.has_eval, self.top_level_mark);
}
}

Expand All @@ -45,14 +51,16 @@ impl Analyzer {
{
let mut v = Analyzer {
safari_10: self.safari_10,
has_eval: self.has_eval,
top_level_mark: self.top_level_mark,

is_pat_decl: self.is_pat_decl,
var_belong_to_fn_scope: false,
in_catch_params: false,
scope: Scope {
kind,
..Default::default()
},
is_pat_decl: self.is_pat_decl,
var_belong_to_fn_scope: false,
in_catch_params: false,
hoisted_vars: Default::default(),
};

Expand Down
8 changes: 6 additions & 2 deletions crates/swc_ecma_transforms_base/src/rename/analyzer/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::{
use rayon::prelude::*;
use rustc_hash::FxHashSet;
use swc_atoms::{js_word, JsWord};
use swc_common::{collections::AHashMap, util::take::Take, SyntaxContext};
use swc_common::{collections::AHashMap, util::take::Take, Mark, SyntaxContext};
use swc_ecma_ast::*;
use tracing::debug;

Expand Down Expand Up @@ -81,13 +81,17 @@ pub(super) struct ScopeData {
}

impl Scope {
pub(super) fn add_decl(&mut self, id: &Id) {
pub(super) fn add_decl(&mut self, id: &Id, has_eval: bool, top_level_mark: Mark) {
if id.0 == js_word!("arguments") {
return;
}

self.data.all.insert(fast_id(id.clone()));
if !self.data.queue.contains(id) {
if has_eval && id.1.outer().is_descendant_of(top_level_mark) {
return;
}

self.data.queue.push(id.clone());
}
}
Expand Down
Loading

1 comment on commit 82bd5c2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 82bd5c2 Previous: ff78b8f Ratio
es/full/bugs-1 304824 ns/iter (± 17137) 295111 ns/iter (± 16896) 1.03
es/full/minify/libraries/antd 1671786358 ns/iter (± 26233988) 1680128647 ns/iter (± 23547024) 1.00
es/full/minify/libraries/d3 312132210 ns/iter (± 8921425) 302234398 ns/iter (± 6244631) 1.03
es/full/minify/libraries/echarts 1272514803 ns/iter (± 21304223) 1256390360 ns/iter (± 8714939) 1.01
es/full/minify/libraries/jquery 94704657 ns/iter (± 1700048) 89492168 ns/iter (± 412475) 1.06
es/full/minify/libraries/lodash 111498775 ns/iter (± 2506590) 104962716 ns/iter (± 1213045) 1.06
es/full/minify/libraries/moment 53998514 ns/iter (± 802692) 52532509 ns/iter (± 416623) 1.03
es/full/minify/libraries/react 19878186 ns/iter (± 315304) 18983768 ns/iter (± 111898) 1.05
es/full/minify/libraries/terser 257491066 ns/iter (± 5177381) 245494361 ns/iter (± 1401205) 1.05
es/full/minify/libraries/three 459634666 ns/iter (± 7966117) 437974852 ns/iter (± 3795905) 1.05
es/full/minify/libraries/typescript 3126787064 ns/iter (± 15401985) 3209235567 ns/iter (± 11931984) 0.97
es/full/minify/libraries/victory 730140735 ns/iter (± 14022495) 669307232 ns/iter (± 7648092) 1.09
es/full/minify/libraries/vue 135877541 ns/iter (± 2385199) 129886275 ns/iter (± 854848) 1.05
es/full/codegen/es3 25644 ns/iter (± 63) 26251 ns/iter (± 140) 0.98
es/full/codegen/es5 25683 ns/iter (± 53) 26250 ns/iter (± 39) 0.98
es/full/codegen/es2015 25584 ns/iter (± 35) 26266 ns/iter (± 62) 0.97
es/full/codegen/es2016 25613 ns/iter (± 61) 26210 ns/iter (± 59) 0.98
es/full/codegen/es2017 25632 ns/iter (± 81) 26226 ns/iter (± 80) 0.98
es/full/codegen/es2018 25642 ns/iter (± 72) 26216 ns/iter (± 63) 0.98
es/full/codegen/es2019 25611 ns/iter (± 59) 26194 ns/iter (± 101) 0.98
es/full/codegen/es2020 25629 ns/iter (± 54) 26142 ns/iter (± 121) 0.98
es/full/all/es3 175130473 ns/iter (± 4795528) 169238517 ns/iter (± 3014886) 1.03
es/full/all/es5 166377968 ns/iter (± 6028401) 162000014 ns/iter (± 4491625) 1.03
es/full/all/es2015 128581967 ns/iter (± 2363123) 123066283 ns/iter (± 1280961) 1.04
es/full/all/es2016 128339470 ns/iter (± 1916900) 120950620 ns/iter (± 672051) 1.06
es/full/all/es2017 126152612 ns/iter (± 2027771) 120414797 ns/iter (± 771047) 1.05
es/full/all/es2018 125607788 ns/iter (± 2391921) 119106359 ns/iter (± 733289) 1.05
es/full/all/es2019 122956960 ns/iter (± 2178771) 118196666 ns/iter (± 735222) 1.04
es/full/all/es2020 119438580 ns/iter (± 2816432) 113395914 ns/iter (± 986321) 1.05
es/full/parser 538693 ns/iter (± 7835) 539176 ns/iter (± 8153) 1.00
es/full/base/fixer 21918 ns/iter (± 40) 22065 ns/iter (± 43) 0.99
es/full/base/resolver_and_hygiene 79095 ns/iter (± 82) 79831 ns/iter (± 105) 0.99
serialization of ast node 145 ns/iter (± 1) 145 ns/iter (± 0) 1
serialization of serde 130 ns/iter (± 0) 132 ns/iter (± 0) 0.98
css/minify/libraries/bootstrap 28061860 ns/iter (± 92962) 27755783 ns/iter (± 247454) 1.01
css/visitor/compare/clone 2061658 ns/iter (± 18919) 2091515 ns/iter (± 8170) 0.99
css/visitor/compare/visit_mut_span 2261713 ns/iter (± 8007) 2256780 ns/iter (± 2701) 1.00
css/visitor/compare/visit_mut_span_panic 2324204 ns/iter (± 10996) 2342644 ns/iter (± 5970) 0.99
css/visitor/compare/fold_span 3040731 ns/iter (± 37229) 3085293 ns/iter (± 20814) 0.99
css/visitor/compare/fold_span_panic 3165803 ns/iter (± 12247) 3148981 ns/iter (± 23180) 1.01
css/lexer/bootstrap_5_1_3 5157137 ns/iter (± 1339) 5170005 ns/iter (± 6301) 1.00
css/lexer/foundation_6_7_4 4335943 ns/iter (± 4437) 4348867 ns/iter (± 4109) 1.00
css/lexer/tailwind_3_1_1 826398 ns/iter (± 1849) 827394 ns/iter (± 1769) 1.00
css/parser/bootstrap_5_1_3 21864052 ns/iter (± 127974) 21526990 ns/iter (± 48804) 1.02
css/parser/foundation_6_7_4 17375799 ns/iter (± 89405) 17119472 ns/iter (± 57317) 1.01
css/parser/tailwind_3_1_1 3315858 ns/iter (± 2241) 3304146 ns/iter (± 17404) 1.00
es/codegen/colors 329857 ns/iter (± 184749) 329116 ns/iter (± 184962) 1.00
es/codegen/large 1192363 ns/iter (± 609417) 1214477 ns/iter (± 630704) 0.98
es/codegen/with-parser/colors 48450 ns/iter (± 339) 48576 ns/iter (± 351) 1.00
es/codegen/with-parser/large 536817 ns/iter (± 2353) 532732 ns/iter (± 1881) 1.01
es/minify/libraries/antd 1464234589 ns/iter (± 18554281) 1470006385 ns/iter (± 20867572) 1.00
es/minify/libraries/d3 264890160 ns/iter (± 9372730) 251152729 ns/iter (± 4124471) 1.05
es/minify/libraries/echarts 1115878354 ns/iter (± 25059237) 1072330149 ns/iter (± 10252582) 1.04
es/minify/libraries/jquery 80459958 ns/iter (± 905069) 77055814 ns/iter (± 500506) 1.04
es/minify/libraries/lodash 96930134 ns/iter (± 1638556) 94218308 ns/iter (± 1368156) 1.03
es/minify/libraries/moment 46710259 ns/iter (± 1075542) 45300337 ns/iter (± 181547) 1.03
es/minify/libraries/react 17406616 ns/iter (± 338125) 16768671 ns/iter (± 73296) 1.04
es/minify/libraries/terser 223492251 ns/iter (± 5785699) 211486512 ns/iter (± 4394916) 1.06
es/minify/libraries/three 400731266 ns/iter (± 14599261) 360990279 ns/iter (± 3704829) 1.11
es/minify/libraries/typescript 2688768006 ns/iter (± 25655696) 2828154446 ns/iter (± 43196056) 0.95
es/minify/libraries/victory 604219226 ns/iter (± 22133713) 575960525 ns/iter (± 5207387) 1.05
es/minify/libraries/vue 119481059 ns/iter (± 2123257) 115982961 ns/iter (± 931630) 1.03
es/visitor/compare/clone 2428875 ns/iter (± 13154) 2416421 ns/iter (± 12342) 1.01
es/visitor/compare/visit_mut_span 2816672 ns/iter (± 29592) 2770322 ns/iter (± 3459) 1.02
es/visitor/compare/visit_mut_span_panic 2843806 ns/iter (± 29988) 2823930 ns/iter (± 4717) 1.01
es/visitor/compare/fold_span 3994071 ns/iter (± 24399) 3902664 ns/iter (± 8288) 1.02
es/visitor/compare/fold_span_panic 4089319 ns/iter (± 17965) 4080627 ns/iter (± 6250) 1.00
es/lexer/colors 17173 ns/iter (± 14) 17249 ns/iter (± 12) 1.00
es/lexer/angular 8256626 ns/iter (± 3162) 8249266 ns/iter (± 4460) 1.00
es/lexer/backbone 1078022 ns/iter (± 1357) 1081490 ns/iter (± 597) 1.00
es/lexer/jquery 5959136 ns/iter (± 1872) 5999557 ns/iter (± 5337) 0.99
es/lexer/jquery mobile 9187350 ns/iter (± 3581) 9242252 ns/iter (± 8381) 0.99
es/lexer/mootools 4676690 ns/iter (± 10858) 4693012 ns/iter (± 3456) 1.00
es/lexer/underscore 900132 ns/iter (± 1140) 900267 ns/iter (± 288) 1.00
es/lexer/three 27899578 ns/iter (± 19324) 28025355 ns/iter (± 60345) 1.00
es/lexer/yui 5054381 ns/iter (± 8154) 5052582 ns/iter (± 2455) 1.00
es/parser/colors 30745 ns/iter (± 110) 31799 ns/iter (± 91) 0.97
es/parser/angular 15648782 ns/iter (± 182492) 16251067 ns/iter (± 250593) 0.96
es/parser/backbone 2340780 ns/iter (± 12926) 2348502 ns/iter (± 14921) 1.00
es/parser/jquery 12701909 ns/iter (± 80641) 12645220 ns/iter (± 62060) 1.00
es/parser/jquery mobile 20339852 ns/iter (± 259542) 19942695 ns/iter (± 358419) 1.02
es/parser/mootools 9752872 ns/iter (± 27287) 9637981 ns/iter (± 34155) 1.01
es/parser/underscore 1992775 ns/iter (± 12620) 1992652 ns/iter (± 12316) 1.00
es/parser/three 60513468 ns/iter (± 379017) 58799528 ns/iter (± 604131) 1.03
es/parser/yui 9713487 ns/iter (± 42978) 9784201 ns/iter (± 47292) 0.99
es/preset-env/usage/builtin_type 142798 ns/iter (± 32917) 139189 ns/iter (± 31294) 1.03
es/preset-env/usage/property 21215 ns/iter (± 64) 21368 ns/iter (± 98) 0.99
es/resolver/typescript 111677355 ns/iter (± 2219303) 118681510 ns/iter (± 2197098) 0.94
es/fixer/typescript 85907361 ns/iter (± 500667) 97614557 ns/iter (± 2995652) 0.88
es/hygiene/typescript 182787583 ns/iter (± 1081686) 207777378 ns/iter (± 2737012) 0.88
es/resolver_with_hygiene/typescript 328124543 ns/iter (± 4606613) 350265583 ns/iter (± 2111743) 0.94
es/visitor/base-perf/module_clone 74624 ns/iter (± 2109) 76629 ns/iter (± 1144) 0.97
es/visitor/base-perf/fold_empty 84985 ns/iter (± 1764) 86466 ns/iter (± 1204) 0.98
es/visitor/base-perf/fold_noop_impl_all 85285 ns/iter (± 1604) 86221 ns/iter (± 886) 0.99
es/visitor/base-perf/fold_noop_impl_vec 85525 ns/iter (± 1362) 86589 ns/iter (± 852) 0.99
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 105 ns/iter (± 0) 106 ns/iter (± 0) 0.99
es/visitor/base-perf/boxing_unboxed 103 ns/iter (± 0) 105 ns/iter (± 0) 0.98
es/visitor/base-perf/visit_contains_this 3566 ns/iter (± 101) 3627 ns/iter (± 52) 0.98
es/base/parallel/resolver/typescript 5733069217 ns/iter (± 434599667) 5826706968 ns/iter (± 543462552) 0.98
es/base/parallel/hygiene/typescript 2116272039 ns/iter (± 30967896) 2374325660 ns/iter (± 16966357) 0.89
misc/visitors/time-complexity/time 5 92 ns/iter (± 0) 108 ns/iter (± 0) 0.85
misc/visitors/time-complexity/time 10 312 ns/iter (± 0) 359 ns/iter (± 1) 0.87
misc/visitors/time-complexity/time 15 600 ns/iter (± 1) 685 ns/iter (± 4) 0.88
misc/visitors/time-complexity/time 20 1122 ns/iter (± 3) 1272 ns/iter (± 1) 0.88
misc/visitors/time-complexity/time 40 5912 ns/iter (± 32) 6791 ns/iter (± 44) 0.87
misc/visitors/time-complexity/time 60 15339 ns/iter (± 46) 17386 ns/iter (± 153) 0.88
es/full-target/es2016 187538 ns/iter (± 571) 190507 ns/iter (± 943) 0.98
es/full-target/es2017 182177 ns/iter (± 521) 184608 ns/iter (± 672) 0.99
es/full-target/es2018 172020 ns/iter (± 642) 173205 ns/iter (± 441) 0.99
es2020_nullish_coalescing 66907 ns/iter (± 7795) 67558 ns/iter (± 145) 0.99
es2020_optional_chaining 95423 ns/iter (± 3108) 96391 ns/iter (± 176) 0.99
es2022_class_properties 94013 ns/iter (± 247) 94516 ns/iter (± 238) 0.99
es2018_object_rest_spread 71179 ns/iter (± 194) 72137 ns/iter (± 123) 0.99
es2019_optional_catch_binding 61449 ns/iter (± 123) 61497 ns/iter (± 136) 1.00
es2017_async_to_generator 61777 ns/iter (± 56) 62602 ns/iter (± 114) 0.99
es2016_exponentiation 64994 ns/iter (± 131) 66323 ns/iter (± 116) 0.98
es2015_arrow 70216 ns/iter (± 181) 70735 ns/iter (± 205) 0.99
es2015_block_scoped_fn 66119 ns/iter (± 193) 67285 ns/iter (± 145) 0.98
es2015_block_scoping 157365 ns/iter (± 10118) 147762 ns/iter (± 9764) 1.06
es2015_classes 116481 ns/iter (± 455) 117734 ns/iter (± 454) 0.99
es2015_computed_props 61434 ns/iter (± 117) 61699 ns/iter (± 93) 1.00
es2015_destructuring 117028 ns/iter (± 188) 115578 ns/iter (± 294) 1.01
es2015_duplicate_keys 64138 ns/iter (± 61) 64235 ns/iter (± 61) 1.00
es2015_parameters 79370 ns/iter (± 149) 80282 ns/iter (± 135) 0.99
es2015_fn_name 66465 ns/iter (± 596) 67180 ns/iter (± 422) 0.99
es2015_for_of 64440 ns/iter (± 92) 65142 ns/iter (± 152) 0.99
es2015_instanceof 63191 ns/iter (± 121) 63576 ns/iter (± 103) 0.99
es2015_shorthand_property 61195 ns/iter (± 87) 61904 ns/iter (± 95) 0.99
es2015_spread 61167 ns/iter (± 158) 61642 ns/iter (± 156) 0.99
es2015_sticky_regex 62452 ns/iter (± 176) 62776 ns/iter (± 127) 0.99
es2015_typeof_symbol 62561 ns/iter (± 112) 62811 ns/iter (± 75) 1.00
es/transform/baseline/base 52031 ns/iter (± 111) 52305 ns/iter (± 87) 0.99
es/transform/baseline/common_reserved_word 62813 ns/iter (± 127) 63289 ns/iter (± 85) 0.99
es/transform/baseline/common_typescript 146508 ns/iter (± 3204) 144872 ns/iter (± 4008) 1.01
es/target/es3 169449 ns/iter (± 874) 171351 ns/iter (± 329) 0.99
es/target/es2015 631565 ns/iter (± 989) 630840 ns/iter (± 1829) 1.00
es/target/es2016 65251 ns/iter (± 167) 66393 ns/iter (± 151) 0.98
es/target/es2017 61709 ns/iter (± 104) 62650 ns/iter (± 105) 0.98
es/target/es2018 81299 ns/iter (± 199) 82335 ns/iter (± 153) 0.99
es/target/es2020 132893 ns/iter (± 212) 133808 ns/iter (± 395) 0.99
babelify-only 675692 ns/iter (± 426) 673462 ns/iter (± 1316) 1.00
parse_and_babelify_angular 42585612 ns/iter (± 1647328) 43337279 ns/iter (± 980284) 0.98
parse_and_babelify_backbone 5517295 ns/iter (± 27594) 5443213 ns/iter (± 44492) 1.01
parse_and_babelify_jquery 32169067 ns/iter (± 336812) 33062274 ns/iter (± 471763) 0.97
parse_and_babelify_jquery_mobile 55116087 ns/iter (± 535615) 55811781 ns/iter (± 903865) 0.99
parse_and_babelify_mootools 33334192 ns/iter (± 211117) 33466255 ns/iter (± 226806) 1.00
parse_and_babelify_underscore 4399509 ns/iter (± 20425) 4344022 ns/iter (± 10431) 1.01
parse_and_babelify_yui 32294726 ns/iter (± 465338) 32966957 ns/iter (± 310363) 0.98
html/minify/document/css_spec 42995682 ns/iter (± 221551) 41797085 ns/iter (± 258628) 1.03
html/minify/document/github 17695641 ns/iter (± 49718) 17423284 ns/iter (± 14593) 1.02
html/minify/document/stackoverflow 15917577 ns/iter (± 90756) 15673424 ns/iter (± 18131) 1.02
html/minify/document_fragment/css_spec 40893666 ns/iter (± 238122) 39758882 ns/iter (± 285499) 1.03
html/minify/document_fragment/github 16832225 ns/iter (± 69165) 16853455 ns/iter (± 14923) 1.00
html/minify/document_fragment/stackoverflow 15221975 ns/iter (± 39813) 15255934 ns/iter (± 11813) 1.00
html/document/visitor/compare/clone 341915 ns/iter (± 2436) 339471 ns/iter (± 2121) 1.01
html/document/visitor/compare/visit_mut_span 366765 ns/iter (± 2454) 365420 ns/iter (± 1559) 1.00
html/document/visitor/compare/visit_mut_span_panic 375650 ns/iter (± 2040) 376643 ns/iter (± 2201) 1.00
html/document/visitor/compare/fold_span 404954 ns/iter (± 2022) 405990 ns/iter (± 2025) 1.00
html/document/visitor/compare/fold_span_panic 461218 ns/iter (± 1079) 464573 ns/iter (± 3050) 0.99
html/document_fragment/visitor/compare/clone 337601 ns/iter (± 1957) 339023 ns/iter (± 1787) 1.00
html/document_fragment/visitor/compare/visit_mut_span 363817 ns/iter (± 1581) 366342 ns/iter (± 1939) 0.99
html/document_fragment/visitor/compare/visit_mut_span_panic 377297 ns/iter (± 1922) 373829 ns/iter (± 2301) 1.01
html/document_fragment/visitor/compare/fold_span 407084 ns/iter (± 1627) 408121 ns/iter (± 2790) 1.00
html/document_fragment/visitor/compare/fold_span_panic 460705 ns/iter (± 1768) 458326 ns/iter (± 1578) 1.01
html/lexer/css_2021_spec 15632490 ns/iter (± 13745) 15587407 ns/iter (± 21710) 1.00
html/lexer/github_com_17_05_2022 6037066 ns/iter (± 1834) 6018909 ns/iter (± 4789) 1.00
html/lexer/stackoverflow_com_17_05_2022 5652062 ns/iter (± 7136) 5616949 ns/iter (± 3505) 1.01
html/parser/parser_document/css_2021_spec 25321289 ns/iter (± 74872) 25773651 ns/iter (± 234002) 0.98
html/parser/parser_document/github_com_17_05_2022 8730962 ns/iter (± 14612) 8745539 ns/iter (± 5867) 1.00
html/parser/parser_document/stackoverflow_com_17_05_2022 7697658 ns/iter (± 23054) 7707589 ns/iter (± 9178) 1.00
html/parser/parser_document_fragment/css_2021_spec 25584372 ns/iter (± 127952) 25829663 ns/iter (± 134795) 0.99
html/parser/parser_document_fragment/github_com_17_05_2022 8764979 ns/iter (± 22436) 8731558 ns/iter (± 9175) 1.00
html/parser/parser_document_fragment/stackoverflow_com_17_05_2022 7762678 ns/iter (± 13508) 7731663 ns/iter (± 6278) 1.00

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

Please sign in to comment.