Skip to content

Commit

Permalink
feat(plugin): Enable validation (#7250)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Apr 12, 2023
1 parent d4782ee commit efad714
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 118 deletions.
1 change: 1 addition & 0 deletions crates/swc_atoms/Cargo.toml
Expand Up @@ -24,6 +24,7 @@ bytecheck = { version = "0.6.9", optional = true }
once_cell = "1"
rkyv = { package = "rkyv", version = "=0.7.40", optional = true, features = [
"strict",
"validation",
] }
# This is to avoid cargo version selection conflict between rkyv=0.7.40 and other versions, as it is strictly pinned
# cannot be merged.
Expand Down
25 changes: 14 additions & 11 deletions crates/swc_common/Cargo.toml
Expand Up @@ -49,18 +49,21 @@ rkyv-impl = ["__rkyv", "rkyv", "swc_atoms/rkyv-impl"]
rkyv-bytecheck-impl = ["__rkyv", "rkyv-latest", "swc_atoms/rkyv-bytecheck-impl"]

[dependencies]
ahash = "0.7.4"
anyhow = { version = "1.0.45", optional = true }
arbitrary = { version = "1", optional = true, features = ["derive"] }
atty = { version = "0.2", optional = true }
bytecheck = { version = "0.6.9", optional = true }
cfg-if = "1.0.0"
either = "1.5"
ahash = "0.7.4"
anyhow = { version = "1.0.45", optional = true }
arbitrary = { version = "1", optional = true, features = ["derive"] }
atty = { version = "0.2", optional = true }
bytecheck = { version = "0.6.9", optional = true }
cfg-if = "1.0.0"
either = "1.5"
new_debug_unreachable = "1.0.4"
num-bigint = "0.4"
once_cell = "1.10.0"
parking_lot = { version = "0.12.0", optional = true }
rkyv = { version = "=0.7.40", optional = true, features = ["strict"] }
num-bigint = "0.4"
once_cell = "1.10.0"
parking_lot = { version = "0.12.0", optional = true }
rkyv = { version = "=0.7.40", optional = true, features = [
"strict",
"validation",
] }
# This is to avoid cargo version selection conflict between rkyv=0.7.40 and other versions, as it is strictly pinned
# cannot be merged.
rkyv-latest = { package = "rkyv-test", version = "=0.7.38-test.2", optional = true }
Expand Down
9 changes: 2 additions & 7 deletions crates/swc_common/src/plugin/serialized.rs
Expand Up @@ -140,12 +140,8 @@ where
/// SharedSerializeRegistry which cannot be Infallible. Internally this does
/// not call deserialize with Infallible deserializer, use
/// SharedDeserializeMap instead.
///
/// # Safety
/// This is unsafe by construting bytes slice from raw ptr also deserialize
/// it without slice bound check.
#[tracing::instrument(level = "info", skip_all)]
pub unsafe fn deserialize_from_ptr_into_fallible<W>(
pub fn deserialize_from_ptr_into_fallible<W>(
raw_allocated_ptr: *const u8,
raw_allocated_ptr_len: u32,
) -> Result<W, Error>
Expand All @@ -156,8 +152,7 @@ where
let serialized =
PluginSerializedBytes::from_raw_ptr(raw_allocated_ptr, raw_allocated_ptr_len as usize);

rkyv::from_bytes_unchecked(&serialized.field)
.map_err(|_err| Error::msg("Failed to deserialize given ptr"))
serialized.deserialize()
}

/*
Expand Down
9 changes: 6 additions & 3 deletions crates/swc_css_ast/Cargo.toml
Expand Up @@ -20,9 +20,12 @@ serde-impl = ["serde"]

[dependencies]
bytecheck = { version = "0.6.9", optional = true }
is-macro = "0.2.0"
rkyv = { version = "=0.7.40", optional = true, features = ["strict"] }
serde = { version = "1.0.127", features = ["derive"], optional = true }
is-macro = "0.2.0"
rkyv = { version = "=0.7.40", optional = true, features = [
"strict",
"validation",
] }
serde = { version = "1.0.127", features = ["derive"], optional = true }

string_enum = { version = "0.4.0", path = "../string_enum/" }
swc_atoms = { version = "0.5.0", path = "../swc_atoms" }
Expand Down
1 change: 1 addition & 0 deletions crates/swc_ecma_ast/Cargo.toml
Expand Up @@ -38,6 +38,7 @@ is-macro = "0.2.1"
num-bigint = { version = "0.4", features = ["serde"] }
rkyv = { package = "rkyv", version = "=0.7.40", optional = true, features = [
"strict",
"validation",
] }
# This is to avoid cargo version selection conflict between rkyv=0.7.40 and other versions, as it is strictly pinned
# cannot be merged.
Expand Down
9 changes: 6 additions & 3 deletions crates/swc_html_ast/Cargo.toml
Expand Up @@ -22,9 +22,12 @@ serde-impl = ["serde"]

[dependencies]
bytecheck = { version = "0.6.9", optional = true }
is-macro = "0.2.0"
rkyv = { version = "=0.7.40", optional = true, features = ["strict"] }
serde = { version = "1.0.127", features = ["derive"], optional = true }
is-macro = "0.2.0"
rkyv = { version = "=0.7.40", optional = true, features = [
"strict",
"validation",
] }
serde = { version = "1.0.127", features = ["derive"], optional = true }

string_enum = { version = "0.4.0", path = "../string_enum/" }
swc_atoms = { version = "0.5.0", path = "../swc_atoms" }
Expand Down
1 change: 1 addition & 0 deletions crates/swc_plugin_proxy/Cargo.toml
Expand Up @@ -39,6 +39,7 @@ plugin-mode = ["__plugin_mode", "swc_common/plugin-base", "rkyv-impl"]

rkyv = { package = "rkyv", version = "=0.7.40", optional = true, features = [
"strict",
"validation",
] }
# This is to avoid cargo version selection conflict between rkyv=0.7.40 and other versions, as it is strictly pinned
# cannot be merged.
Expand Down
6 changes: 2 additions & 4 deletions crates/swc_plugin_proxy/src/memory_interop/mod.rs
@@ -1,6 +1,4 @@
mod read_returned_result_from_host;
pub use read_returned_result_from_host::AllocatedBytesPtr;
#[cfg(all(feature = "__rkyv", feature = "__plugin_mode", target_arch = "wasm32"))]
pub(crate) use read_returned_result_from_host::{
read_returned_result_from_host, read_returned_result_from_host_fallible,
};
pub(crate) use read_returned_result_from_host::read_returned_result_from_host;
pub use read_returned_result_from_host::AllocatedBytesPtr;
Expand Up @@ -2,9 +2,7 @@
use rkyv_latest as rkyv;
#[cfg_attr(not(target_arch = "wasm32"), allow(unused))]
#[cfg(any(feature = "__plugin_rt", feature = "__plugin_mode"))]
use swc_common::plugin::serialized::{
deserialize_from_ptr, deserialize_from_ptr_into_fallible, PluginSerializedBytes,
};
use swc_common::plugin::serialized::{deserialize_from_ptr, PluginSerializedBytes};

/// A struct to exchange allocated data between memory spaces.
#[cfg_attr(
Expand Down Expand Up @@ -89,58 +87,3 @@ where
.expect("Returned value should be serializable")
})
}

#[cfg(not(feature = "__rkyv"))]
pub fn read_returned_result_from_host_fallible<F, R>(f: F) -> Option<R> {
unimplemented!("Plugin proxy does not work without serialization support")
}

/// Performs deserialization to the actual return value type from returned ptr.
///
/// This behaves same as read_returned_result_from_host, the only difference is
/// this is for the `Fallible` struct to deserialize. If a struct contains
/// shared pointers like Arc, Rc rkyv requires trait bounds to the
/// SharedSerializeRegistry which cannot be infallible.
#[cfg(all(feature = "__rkyv", target_arch = "wasm32"))]
#[tracing::instrument(level = "info", skip_all)]
pub fn read_returned_result_from_host_fallible<F, R>(f: F) -> Option<R>
where
F: FnOnce(u32) -> u32,
R: rkyv::Archive,
R::Archived: rkyv::Deserialize<R, rkyv::de::deserializers::SharedDeserializeMap>,
{
// Allocate AllocatedBytesPtr to get return value from the host
let allocated_bytes_ptr = AllocatedBytesPtr(0, 0);
let serialized_allocated_bytes_ptr = PluginSerializedBytes::try_serialize(&allocated_bytes_ptr)
.expect("Should able to serialize AllocatedBytesPtr");
let (serialized_allocated_bytes_raw_ptr, serialized_allocated_bytes_raw_ptr_size) =
serialized_allocated_bytes_ptr.as_ptr();

let ret = f(serialized_allocated_bytes_raw_ptr as _);

// Host fn call completes: by contract in host proxy, if return value is 0
// we know there's no value to read. Otherwise, we know host filled in
// AllocatedBytesPtr to the pointer for the actual value for the
// results.
if ret == 0 {
return None;
}

// Now reconstruct AllocatedBytesPtr to reveal ptr to the allocated bytes
let allocated_returned_value_ptr: AllocatedBytesPtr = unsafe {
deserialize_from_ptr(
serialized_allocated_bytes_raw_ptr,
serialized_allocated_bytes_raw_ptr_size as u32,
)
.expect("Should able to deserialize AllocatedBytesPtr")
};

// Using AllocatedBytesPtr's value, reconstruct actual return value
Some(unsafe {
deserialize_from_ptr_into_fallible(
allocated_returned_value_ptr.0 as _,
allocated_returned_value_ptr.1,
)
.expect("Returned value should be serializable")
})
}
27 changes: 13 additions & 14 deletions crates/swc_plugin_proxy/src/source_map/plugin_source_map_proxy.rs
Expand Up @@ -14,7 +14,7 @@ use swc_ecma_ast::SourceMapperExt;
use swc_trace_macro::swc_trace;

#[cfg(all(feature = "__rkyv", feature = "__plugin_mode", target_arch = "wasm32"))]
use crate::memory_interop::read_returned_result_from_host_fallible;
use crate::memory_interop::read_returned_result_from_host;

#[cfg(target_arch = "wasm32")]
extern "C" {
Expand Down Expand Up @@ -84,7 +84,7 @@ impl PluginSourceMapProxy {
#[cfg(target_arch = "wasm32")]
{
let src: Result<String, Box<SpanSnippetError>> =
read_returned_result_from_host_fallible(|serialized_ptr| unsafe {
read_returned_result_from_host(|serialized_ptr| unsafe {
__span_to_source_proxy(sp.lo.0, sp.hi.0, sp.ctxt.as_u32(), serialized_ptr)
})
.expect("Host should return source code");
Expand All @@ -111,15 +111,14 @@ impl SourceMapper for PluginSourceMapProxy {
} else {
0
};
let partial_loc: PartialLoc =
read_returned_result_from_host_fallible(|serialized_ptr| unsafe {
__lookup_char_pos_source_map_proxy(
pos.0,
should_request_source_file,
serialized_ptr,
)
})
.expect("Host should return PartialLoc");
let partial_loc: PartialLoc = read_returned_result_from_host(|serialized_ptr| unsafe {
__lookup_char_pos_source_map_proxy(
pos.0,
should_request_source_file,
serialized_ptr,
)
})
.expect("Host should return PartialLoc");

if self.source_file.get().is_none() {
if let Some(source_file) = partial_loc.source_file {
Expand Down Expand Up @@ -154,7 +153,7 @@ impl SourceMapper for PluginSourceMapProxy {
0
};
let partial_files: PartialFileLinesResult =
read_returned_result_from_host_fallible(|serialized_ptr| unsafe {
read_returned_result_from_host(|serialized_ptr| unsafe {
__span_to_lines_proxy(
sp.lo.0,
sp.hi.0,
Expand Down Expand Up @@ -191,7 +190,7 @@ impl SourceMapper for PluginSourceMapProxy {

fn span_to_string(&self, sp: Span) -> String {
#[cfg(target_arch = "wasm32")]
return read_returned_result_from_host_fallible(|serialized_ptr| unsafe {
return read_returned_result_from_host(|serialized_ptr| unsafe {
__span_to_string_proxy(sp.lo.0, sp.hi.0, sp.ctxt.as_u32(), serialized_ptr)
})
.expect("Host should return String");
Expand All @@ -202,7 +201,7 @@ impl SourceMapper for PluginSourceMapProxy {

fn span_to_filename(&self, sp: Span) -> FileName {
#[cfg(target_arch = "wasm32")]
return read_returned_result_from_host_fallible(|serialized_ptr| unsafe {
return read_returned_result_from_host(|serialized_ptr| unsafe {
__span_to_filename_proxy(sp.lo.0, sp.hi.0, sp.ctxt.as_u32(), serialized_ptr)
})
.expect("Host should return Filename");
Expand Down
27 changes: 14 additions & 13 deletions crates/swc_plugin_runner/src/imported_fn/source_map.rs
Expand Up @@ -46,12 +46,17 @@ pub fn lookup_char_pos_proxy(
byte_pos: u32,
should_include_source_file: i32,
allocated_ret_ptr: u32,
) -> i32 {
) -> u32 {
let memory = env.data().memory.clone();
let memory = memory
.as_ref()
.expect("Memory instance should be available, check initialization");

let alloc_guest_memory = env.data().alloc_guest_memory.clone();
let alloc_guest_memory = alloc_guest_memory
.as_ref()
.expect("Alloc guest memory fn should be available, check initialization");

let original_loc = (env.data().source_map.lock()).lookup_char_pos(BytePos(byte_pos));
let ret = PartialLoc {
source_file: if should_include_source_file == 0 {
Expand All @@ -67,18 +72,14 @@ pub fn lookup_char_pos_proxy(
let serialized_loc_bytes =
PluginSerializedBytes::try_serialize(&ret).expect("Should be serializable");

if let Some(alloc_guest_memory) = env.data().alloc_guest_memory.clone().as_ref() {
allocate_return_values_into_guest(
memory,
&mut env.as_store_mut(),
alloc_guest_memory,
allocated_ret_ptr,
&serialized_loc_bytes,
);
1
} else {
0
}
allocate_return_values_into_guest(
memory,
&mut env.as_store_mut(),
alloc_guest_memory,
allocated_ret_ptr,
&serialized_loc_bytes,
);
1
}

#[tracing::instrument(level = "info", skip_all)]
Expand Down
5 changes: 3 additions & 2 deletions crates/swc_plugin_runner/src/memory_interop.rs
Expand Up @@ -5,8 +5,9 @@ use wasmer::{Memory, MemoryView, StoreMut, TypedFunction, WasmPtr};
#[tracing::instrument(level = "info", skip_all)]
pub fn copy_bytes_into_host(memory: &MemoryView, bytes_ptr: i32, bytes_ptr_len: i32) -> Vec<u8> {
let ptr: WasmPtr<u8> = WasmPtr::new(bytes_ptr as _);
let _derefed_ptr = ptr.deref(memory);
let values = ptr.slice(memory, bytes_ptr_len as u32).expect("xxx");
let values = ptr
.slice(memory, bytes_ptr_len as u32)
.expect("Should able to get a slice from memory view");

values
.read_to_vec()
Expand Down
@@ -1,5 +1,5 @@
use swc_core::{
common::DUMMY_SP,
common::{SourceMapper, DUMMY_SP},
ecma::{ast::*, atoms::*, visit::*},
plugin::{
errors::HANDLER,
Expand All @@ -9,7 +9,9 @@ use swc_core::{
quote,
};

struct ConsoleOutputReplacer;
struct ConsoleOutputReplacer {
metadata: TransformPluginProgramMetadata,
}

/// An example plugin replaces any `console.log(${text})` into
/// `console.log('changed_via_plugin')`.
Expand All @@ -18,6 +20,10 @@ impl VisitMut for ConsoleOutputReplacer {
if let Callee::Expr(expr) = &call.callee {
if let Expr::Member(MemberExpr { obj, .. }) = &**expr {
if let Expr::Ident(ident) = &**obj {
println!(
"lookup_char_pos {:#?}",
self.metadata.source_map.lookup_char_pos(ident.span.lo)
);
if ident.sym == *"console" {
call.args[0].expr = Box::new(Expr::Lit(Lit::Str(Str {
span: DUMMY_SP,
Expand Down Expand Up @@ -101,5 +107,5 @@ pub fn process(program: Program, metadata: TransformPluginProgramMetadata) -> Pr
panic!("Plugin config should be testValue");
}

program.fold_with(&mut as_folder(ConsoleOutputReplacer))
program.fold_with(&mut as_folder(ConsoleOutputReplacer { metadata }))
}

1 comment on commit efad714

@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: efad714 Previous: 2e947e7 Ratio
es/full/bugs-1 298870 ns/iter (± 7005) 319841 ns/iter (± 11750) 0.93
es/full/minify/libraries/antd 1593269511 ns/iter (± 23676829) 1598574737 ns/iter (± 17935378) 1.00
es/full/minify/libraries/d3 295168014 ns/iter (± 9016539) 299333735 ns/iter (± 9891090) 0.99
es/full/minify/libraries/echarts 1194176872 ns/iter (± 32679715) 1229622569 ns/iter (± 11519514) 0.97
es/full/minify/libraries/jquery 88586492 ns/iter (± 369378) 90837007 ns/iter (± 854164) 0.98
es/full/minify/libraries/lodash 105730097 ns/iter (± 1437536) 107023415 ns/iter (± 1199954) 0.99
es/full/minify/libraries/moment 51712264 ns/iter (± 478442) 52444737 ns/iter (± 755033) 0.99
es/full/minify/libraries/react 18854006 ns/iter (± 173171) 19120961 ns/iter (± 274679) 0.99
es/full/minify/libraries/terser 244258662 ns/iter (± 8140308) 246653632 ns/iter (± 8169385) 0.99
es/full/minify/libraries/three 416980691 ns/iter (± 9391947) 447032834 ns/iter (± 8336998) 0.93
es/full/minify/libraries/typescript 3001192283 ns/iter (± 31752719) 2980949680 ns/iter (± 14891421) 1.01
es/full/minify/libraries/victory 633052363 ns/iter (± 18253383) 686469403 ns/iter (± 12218935) 0.92
es/full/minify/libraries/vue 127952078 ns/iter (± 2049194) 132518779 ns/iter (± 3198801) 0.97
es/full/codegen/es3 28901 ns/iter (± 171) 28588 ns/iter (± 117) 1.01
es/full/codegen/es5 29268 ns/iter (± 66) 28633 ns/iter (± 68) 1.02
es/full/codegen/es2015 29279 ns/iter (± 73) 28662 ns/iter (± 59) 1.02
es/full/codegen/es2016 29117 ns/iter (± 101) 28653 ns/iter (± 50) 1.02
es/full/codegen/es2017 28871 ns/iter (± 130) 28662 ns/iter (± 57) 1.01
es/full/codegen/es2018 28882 ns/iter (± 170) 28673 ns/iter (± 67) 1.01
es/full/codegen/es2019 28948 ns/iter (± 150) 28619 ns/iter (± 33) 1.01
es/full/codegen/es2020 29235 ns/iter (± 83) 28642 ns/iter (± 59) 1.02
es/full/all/es3 178945479 ns/iter (± 3094523) 181465576 ns/iter (± 3503722) 0.99
es/full/all/es5 173458037 ns/iter (± 2919365) 175541080 ns/iter (± 2348694) 0.99
es/full/all/es2015 136065048 ns/iter (± 1637026) 134701490 ns/iter (± 3126389) 1.01
es/full/all/es2016 133348399 ns/iter (± 1013890) 133287230 ns/iter (± 1351787) 1.00
es/full/all/es2017 131680888 ns/iter (± 1929595) 132806810 ns/iter (± 2384609) 0.99
es/full/all/es2018 127424674 ns/iter (± 2162704) 127118127 ns/iter (± 2110436) 1.00
es/full/all/es2019 125574000 ns/iter (± 2542888) 127084738 ns/iter (± 1823082) 0.99
es/full/all/es2020 117460893 ns/iter (± 517941) 118715970 ns/iter (± 1367735) 0.99
es/full/parser 519488 ns/iter (± 8991) 507971 ns/iter (± 8354) 1.02
es/full/base/fixer 24679 ns/iter (± 50) 23215 ns/iter (± 50) 1.06
es/full/base/resolver_and_hygiene 83270 ns/iter (± 403) 84303 ns/iter (± 1426) 0.99
serialization of serde 119 ns/iter (± 0) 120 ns/iter (± 0) 0.99
css/minify/libraries/bootstrap 26993948 ns/iter (± 217568) 27694096 ns/iter (± 174392) 0.97
css/visitor/compare/clone 2140844 ns/iter (± 27159) 2138700 ns/iter (± 13022) 1.00
css/visitor/compare/visit_mut_span 2326474 ns/iter (± 5660) 2327704 ns/iter (± 5947) 1.00
css/visitor/compare/visit_mut_span_panic 2408498 ns/iter (± 7229) 2374429 ns/iter (± 12612) 1.01
css/visitor/compare/fold_span 3133601 ns/iter (± 12575) 3117002 ns/iter (± 13920) 1.01
css/visitor/compare/fold_span_panic 3278984 ns/iter (± 16961) 3269839 ns/iter (± 11692) 1.00
css/lexer/bootstrap_5_1_3 5055848 ns/iter (± 40268) 5126547 ns/iter (± 4996) 0.99
css/lexer/foundation_6_7_4 4325812 ns/iter (± 11942) 4319596 ns/iter (± 3383) 1.00
css/lexer/tailwind_3_1_1 812018 ns/iter (± 3113) 820941 ns/iter (± 571) 0.99
css/parser/bootstrap_5_1_3 20630586 ns/iter (± 104124) 21331778 ns/iter (± 156274) 0.97
css/parser/foundation_6_7_4 16621655 ns/iter (± 100036) 16854889 ns/iter (± 57380) 0.99
css/parser/tailwind_3_1_1 3219144 ns/iter (± 15813) 3260791 ns/iter (± 4511) 0.99
es/codegen/colors 327853 ns/iter (± 185675) 317318 ns/iter (± 180354) 1.03
es/codegen/large 1265960 ns/iter (± 629675) 1330943 ns/iter (± 638891) 0.95
es/codegen/with-parser/colors 46566 ns/iter (± 385) 47122 ns/iter (± 255) 0.99
es/codegen/with-parser/large 505073 ns/iter (± 3487) 507945 ns/iter (± 1086) 0.99
es/minify/libraries/antd 1347016514 ns/iter (± 34507546) 1382987100 ns/iter (± 12607535) 0.97
es/minify/libraries/d3 247435160 ns/iter (± 3693338) 258570553 ns/iter (± 4743149) 0.96
es/minify/libraries/echarts 1040473443 ns/iter (± 24244967) 1061884887 ns/iter (± 6311290) 0.98
es/minify/libraries/jquery 77924905 ns/iter (± 785308) 79756150 ns/iter (± 1657326) 0.98
es/minify/libraries/lodash 93355967 ns/iter (± 830391) 94809999 ns/iter (± 1909168) 0.98
es/minify/libraries/moment 45090566 ns/iter (± 466520) 45738653 ns/iter (± 402384) 0.99
es/minify/libraries/react 17086955 ns/iter (± 203665) 17174691 ns/iter (± 222895) 0.99
es/minify/libraries/terser 209909164 ns/iter (± 4590720) 210716749 ns/iter (± 4135258) 1.00
es/minify/libraries/three 362014832 ns/iter (± 10442532) 363620588 ns/iter (± 8487442) 1.00
es/minify/libraries/typescript 2612356086 ns/iter (± 41339764) 2509355106 ns/iter (± 18701281) 1.04
es/minify/libraries/victory 538684199 ns/iter (± 15107898) 574382339 ns/iter (± 11579920) 0.94
es/minify/libraries/vue 113917783 ns/iter (± 767043) 116745440 ns/iter (± 1347402) 0.98
es/visitor/compare/clone 2297385 ns/iter (± 7829) 2339340 ns/iter (± 7312) 0.98
es/visitor/compare/visit_mut_span 2673028 ns/iter (± 19801) 2695320 ns/iter (± 3628) 0.99
es/visitor/compare/visit_mut_span_panic 2721740 ns/iter (± 13489) 2723896 ns/iter (± 3831) 1.00
es/visitor/compare/fold_span 3795604 ns/iter (± 27624) 3799684 ns/iter (± 11297) 1.00
es/visitor/compare/fold_span_panic 3873388 ns/iter (± 30383) 3936049 ns/iter (± 10469) 0.98
es/lexer/colors 13026 ns/iter (± 47) 13091 ns/iter (± 85) 1.00
es/lexer/angular 6265324 ns/iter (± 34204) 6344562 ns/iter (± 2097) 0.99
es/lexer/backbone 776395 ns/iter (± 5189) 781528 ns/iter (± 553) 0.99
es/lexer/jquery 4344092 ns/iter (± 29640) 4385692 ns/iter (± 3343) 0.99
es/lexer/jquery mobile 6840547 ns/iter (± 6894) 6857084 ns/iter (± 9672) 1.00
es/lexer/mootools 3382542 ns/iter (± 21234) 3432173 ns/iter (± 7321) 0.99
es/lexer/underscore 640998 ns/iter (± 1751) 647079 ns/iter (± 702) 0.99
es/lexer/three 20814541 ns/iter (± 61680) 20890170 ns/iter (± 32001) 1.00
es/lexer/yui 3818120 ns/iter (± 15587) 3870943 ns/iter (± 4941) 0.99
es/parser/colors 28953 ns/iter (± 238) 29040 ns/iter (± 84) 1.00
es/parser/angular 14937052 ns/iter (± 248353) 15339952 ns/iter (± 307470) 0.97
es/parser/backbone 2159592 ns/iter (± 10560) 2186741 ns/iter (± 14612) 0.99
es/parser/jquery 11558188 ns/iter (± 171388) 11887295 ns/iter (± 91286) 0.97
es/parser/jquery mobile 17994842 ns/iter (± 226850) 18765530 ns/iter (± 282258) 0.96
es/parser/mootools 8953170 ns/iter (± 47687) 9029073 ns/iter (± 32294) 0.99
es/parser/underscore 1835998 ns/iter (± 11417) 1839203 ns/iter (± 9342) 1.00
es/parser/three 53464472 ns/iter (± 1853432) 54852324 ns/iter (± 477248) 0.97
es/parser/yui 8987690 ns/iter (± 114235) 9188641 ns/iter (± 115998) 0.98
es/preset-env/usage/builtin_type 139827 ns/iter (± 33723) 142176 ns/iter (± 35399) 0.98
es/preset-env/usage/property 19601 ns/iter (± 65) 20392 ns/iter (± 139) 0.96
es/resolver/typescript 117466702 ns/iter (± 2201428) 111173243 ns/iter (± 1765413) 1.06
es/fixer/typescript 83951969 ns/iter (± 1309177) 78846285 ns/iter (± 354346) 1.06
es/hygiene/typescript 182932474 ns/iter (± 3190516) 165564028 ns/iter (± 1936376) 1.10
es/resolver_with_hygiene/typescript 328887226 ns/iter (± 5017390) 311681223 ns/iter (± 2360477) 1.06
es/visitor/base-perf/module_clone 79962 ns/iter (± 895) 80418 ns/iter (± 413) 0.99
es/visitor/base-perf/fold_empty 89712 ns/iter (± 738) 90471 ns/iter (± 290) 0.99
es/visitor/base-perf/fold_noop_impl_all 89965 ns/iter (± 420) 90819 ns/iter (± 406) 0.99
es/visitor/base-perf/fold_noop_impl_vec 89865 ns/iter (± 838) 91049 ns/iter (± 413) 0.99
es/visitor/base-perf/boxing_boxed_clone 56 ns/iter (± 0) 57 ns/iter (± 0) 0.98
es/visitor/base-perf/boxing_unboxed_clone 41 ns/iter (± 0) 41 ns/iter (± 0) 1
es/visitor/base-perf/boxing_boxed 103 ns/iter (± 0) 103 ns/iter (± 0) 1
es/visitor/base-perf/boxing_unboxed 84 ns/iter (± 0) 78 ns/iter (± 0) 1.08
es/visitor/base-perf/visit_contains_this 3522 ns/iter (± 42) 3467 ns/iter (± 56) 1.02
es/base/parallel/resolver/typescript 6045144781 ns/iter (± 495908739) 6087025568 ns/iter (± 327771265) 0.99
es/base/parallel/hygiene/typescript 2282256649 ns/iter (± 23852397) 2013673655 ns/iter (± 30656083) 1.13
misc/visitors/time-complexity/time 5 103 ns/iter (± 0) 103 ns/iter (± 0) 1
misc/visitors/time-complexity/time 10 338 ns/iter (± 2) 338 ns/iter (± 3) 1
misc/visitors/time-complexity/time 15 671 ns/iter (± 10) 657 ns/iter (± 4) 1.02
misc/visitors/time-complexity/time 20 1229 ns/iter (± 1) 1250 ns/iter (± 2) 0.98
misc/visitors/time-complexity/time 40 6217 ns/iter (± 17) 6210 ns/iter (± 4) 1.00
misc/visitors/time-complexity/time 60 15734 ns/iter (± 79) 15598 ns/iter (± 37) 1.01
es/full-target/es2016 252399 ns/iter (± 5083) 254285 ns/iter (± 396) 0.99
es/full-target/es2017 244294 ns/iter (± 778) 247509 ns/iter (± 455) 0.99
es/full-target/es2018 233932 ns/iter (± 411) 236931 ns/iter (± 1562) 0.99
es2020_nullish_coalescing 92547 ns/iter (± 394) 93327 ns/iter (± 411) 0.99
es2020_optional_chaining 124461 ns/iter (± 1066) 123953 ns/iter (± 164) 1.00
es2022_class_properties 148527 ns/iter (± 414) 149176 ns/iter (± 269) 1.00
es2018_object_rest_spread 95616 ns/iter (± 388) 96831 ns/iter (± 200) 0.99
es2019_optional_catch_binding 85153 ns/iter (± 211) 85379 ns/iter (± 193) 1.00
es2017_async_to_generator 85397 ns/iter (± 274) 86102 ns/iter (± 306) 0.99
es2016_exponentiation 89940 ns/iter (± 997) 90219 ns/iter (± 309) 1.00
es2015_arrow 93955 ns/iter (± 196) 94127 ns/iter (± 304) 1.00
es2015_block_scoped_fn 91997 ns/iter (± 207) 92105 ns/iter (± 245) 1.00
es2015_block_scoping 170372 ns/iter (± 271) 169942 ns/iter (± 279) 1.00

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

Please sign in to comment.