Skip to content

Commit

Permalink
feat(plugin): Add versioned wrapper struct (#7382)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed May 15, 2023
1 parent 5d30437 commit bba1fad
Show file tree
Hide file tree
Showing 27 changed files with 262 additions and 194 deletions.
136 changes: 68 additions & 68 deletions bindings/Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bindings/binding_core_node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ tracing-chrome = "0.5.0"
tracing-futures = "0.2.5"
tracing-subscriber = { version = "0.3.9", features = ["env-filter"] }

swc_core = { version = "0.75.46", features = [
swc_core = { version = "0.76.2", features = [
"allocator_node",
"ecma_ast",
"ecma_ast_serde",
Expand Down
2 changes: 1 addition & 1 deletion bindings/binding_core_wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ plugin = []
anyhow = "1.0.66"
serde = { version = "1", features = ["derive"] }
serde-wasm-bindgen = "0.4.5"
swc_core = { version = "0.75.46", features = [
swc_core = { version = "0.76.2", features = [
"ecma_ast_serde",
"common_perf",
"binding_macro_wasm",
Expand Down
2 changes: 1 addition & 1 deletion bindings/swc_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ relative-path = "1.6.1"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["unbounded_depth"] }
sourcemap = "6.2.2"
swc_core = { version = "0.75.46", features = [
swc_core = { version = "0.76.2", features = [
"trace_macro",
"common_concurrent",
"base_concurrent",
Expand Down
18 changes: 10 additions & 8 deletions crates/swc/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ impl RustPlugins {
},
|| {
let span = tracing::span!(tracing::Level::INFO, "serialize_program").entered();
let mut serialized_program = PluginSerializedBytes::try_serialize(&n)?;
let program = swc_common::plugin::serialized::VersionedSerializable::new(n);
let mut serialized = PluginSerializedBytes::try_serialize(&program)?;
drop(span);

// Run plugin transformation against current program.
Expand Down Expand Up @@ -137,9 +138,9 @@ impl RustPlugins {
)
.entered();

serialized_program = transform_plugin_executor
serialized = transform_plugin_executor
.transform(
&serialized_program,
&serialized,
self.unresolved_mark,
should_enable_comments_proxy,
)
Expand All @@ -156,7 +157,7 @@ impl RustPlugins {

// Plugin transformation is done. Deserialize transformed bytes back
// into Program
serialized_program.deserialize()
serialized.deserialize().map(|v| v.into_inner())
},
)
}
Expand All @@ -179,7 +180,8 @@ impl RustPlugins {
inner: self.comments.clone(),
},
|| {
let mut serialized_program = PluginSerializedBytes::try_serialize(&n)?;
let program = swc_common::plugin::serialized::VersionedSerializable::new(n);
let mut serialized = PluginSerializedBytes::try_serialize(&program)?;

if let Some(plugins) = &mut self.plugins {
for p in plugins.drain(..) {
Expand All @@ -192,9 +194,9 @@ impl RustPlugins {
Some(p.1),
)?;

serialized_program = transform_plugin_executor
serialized = transform_plugin_executor
.transform(
&serialized_program,
&serialized,
self.unresolved_mark,
should_enable_comments_proxy,
)
Expand All @@ -204,7 +206,7 @@ impl RustPlugins {
}
}

serialized_program.deserialize()
serialized_program.deserialize().map(|v| v.into_inner())
},
)
}
Expand Down
50 changes: 21 additions & 29 deletions crates/swc_common/src/plugin/serialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl PluginSerializedBytes {
* to implement TryFrom trait
*/
#[tracing::instrument(level = "info", skip_all)]
pub fn try_serialize<W>(t: &W) -> Result<Self, Error>
pub fn try_serialize<W>(t: &VersionedSerializable<W>) -> Result<Self, Error>
where
W: rkyv::Serialize<rkyv::ser::serializers::AllocSerializer<512>>,
{
Expand Down Expand Up @@ -99,14 +99,14 @@ impl PluginSerializedBytes {
}

#[tracing::instrument(level = "info", skip_all)]
pub fn deserialize<W>(&self) -> Result<W, Error>
pub fn deserialize<W>(&self) -> Result<VersionedSerializable<W>, Error>
where
W: rkyv::Archive,
W::Archived: rkyv::Deserialize<W, rkyv::de::deserializers::SharedDeserializeMap>,
{
use anyhow::Context;

let archived = unsafe { rkyv::archived_root::<W>(&self.field[..]) };
let archived = unsafe { rkyv::archived_root::<VersionedSerializable<W>>(&self.field[..]) };

archived
.deserialize(&mut rkyv::de::deserializers::SharedDeserializeMap::new())
Expand All @@ -124,7 +124,7 @@ impl PluginSerializedBytes {
pub unsafe fn deserialize_from_ptr<W>(
raw_allocated_ptr: *const u8,
raw_allocated_ptr_len: u32,
) -> Result<W, Error>
) -> Result<VersionedSerializable<W>, Error>
where
W: rkyv::Archive,
W::Archived: rkyv::Deserialize<W, rkyv::de::deserializers::SharedDeserializeMap>,
Expand All @@ -135,37 +135,30 @@ where
serialized.deserialize()
}

/// Deserialize `Fallible` struct from raw ptr. This is similar to
/// `deserialize_from_ptr` but for the struct requires bounds to the
/// SharedSerializeRegistry which cannot be Infallible. Internally this does
/// not call deserialize with Infallible deserializer, use
/// SharedDeserializeMap instead.
#[tracing::instrument(level = "info", skip_all)]
pub fn deserialize_from_ptr_into_fallible<W>(
raw_allocated_ptr: *const u8,
raw_allocated_ptr_len: u32,
) -> Result<W, Error>
where
W: rkyv::Archive,
W::Archived: rkyv::Deserialize<W, rkyv::de::deserializers::SharedDeserializeMap>,
{
let serialized =
PluginSerializedBytes::from_raw_ptr(raw_allocated_ptr, raw_allocated_ptr_len as usize);

serialized.deserialize()
}

/*
/// A wrapper type for the structures to be passed into plugins
/// serializes the contained value out-of-line so that newer
/// versions can be viewed as the older version.
///
#[derive(Archive, Deserialize, Serialize)]
pub struct VersionedSerializable<T>(#[with(AsBox)] T);
/// First field indicate version of struct type (schema). Any consumers like
/// swc_plugin_macro can use this to validate compatiblility before attempt to
/// serialize.
#[cfg_attr(
feature = "__plugin",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[repr(transparent)]
#[cfg_attr(feature = "__plugin", archive(check_bytes))]
#[cfg_attr(feature = "__plugin", archive_attr(repr(transparent)))]
#[derive(Debug)]
pub struct VersionedSerializable<T>(
// [NOTE]: https://github.com/rkyv/rkyv/issues/373#issuecomment-1546360897
//#[cfg_attr(feature = "__plugin", with(rkyv::with::AsBox))]
pub T,
);

impl<T> VersionedSerializable<T> {
pub fn new(value: T) -> Self {
VersionedSerializable(value)
Self(value)
}

pub fn inner(&self) -> &T {
Expand All @@ -176,4 +169,3 @@ impl<T> VersionedSerializable<T> {
self.0
}
}
*/
15 changes: 12 additions & 3 deletions crates/swc_common/src/syntax_pos/hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,10 @@ impl Mark {
pub fn is_descendant_of(mut self, ancestor: Mark) -> bool {
// This code path executed inside of the guest memory context.
// In here, preallocate memory for the context.

use crate::plugin::serialized::VersionedSerializable;
let serialized = crate::plugin::serialized::PluginSerializedBytes::try_serialize(
&MutableMarkContext(0, 0, 0),
&VersionedSerializable::new(MutableMarkContext(0, 0, 0)),
)
.expect("Should be serializable");
let (ptr, len) = serialized.as_ptr();
Expand All @@ -200,6 +202,7 @@ impl Mark {
len.try_into().expect("Should able to convert ptr length"),
)
.expect("Should able to deserialize")
.into_inner()
};
self = Mark::from_u32(context.0);

Expand All @@ -222,8 +225,10 @@ impl Mark {
#[allow(unused_mut, unused_assignments)]
#[cfg(all(feature = "__plugin_mode", target_arch = "wasm32"))]
pub fn least_ancestor(mut a: Mark, mut b: Mark) -> Mark {
use crate::plugin::serialized::VersionedSerializable;

let serialized = crate::plugin::serialized::PluginSerializedBytes::try_serialize(
&MutableMarkContext(0, 0, 0),
&VersionedSerializable::new(MutableMarkContext(0, 0, 0)),
)
.expect("Should be serializable");
let (ptr, len) = serialized.as_ptr();
Expand All @@ -238,6 +243,7 @@ impl Mark {
len.try_into().expect("Should able to convert ptr length"),
)
.expect("Should able to deserialize")
.into_inner()
};
a = Mark::from_u32(context.0);
b = Mark::from_u32(context.1);
Expand Down Expand Up @@ -418,7 +424,9 @@ impl SyntaxContext {

#[cfg(all(feature = "__plugin_mode", target_arch = "wasm32"))]
pub fn remove_mark(&mut self) -> Mark {
let context = MutableMarkContext(0, 0, 0);
use crate::plugin::serialized::VersionedSerializable;

let context = VersionedSerializable::new(MutableMarkContext(0, 0, 0));
let serialized = crate::plugin::serialized::PluginSerializedBytes::try_serialize(&context)
.expect("Should be serializable");
let (ptr, len) = serialized.as_ptr();
Expand All @@ -433,6 +441,7 @@ impl SyntaxContext {
len.try_into().expect("Should able to convert ptr length"),
)
.expect("Should able to deserialize")
.into_inner()
};

*self = SyntaxContext(context.0);
Expand Down
10 changes: 5 additions & 5 deletions crates/swc_plugin_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn handle_func(func: ItemFn, ast_type: Ident) -> TokenStream {
impl swc_core::common::errors::Emitter for PluginDiagnosticsEmitter {
#[cfg_attr(not(target_arch = "wasm32"), allow(unused))]
fn emit(&mut self, db: &swc_core::common::errors::DiagnosticBuilder<'_>) {
let diag = swc_core::common::plugin::serialized::PluginSerializedBytes::try_serialize(&*db.diagnostic)
let diag = swc_core::common::plugin::serialized::PluginSerializedBytes::try_serialize(&swc_core::common::plugin::serialized::VersionedSerializable::new(*db.diagnostic.clone()))
.expect("Should able to serialize Diagnostic");
let (ptr, len) = diag.as_ptr();

Expand All @@ -83,7 +83,7 @@ fn handle_func(func: ItemFn, ast_type: Ident) -> TokenStream {

/// Internal function plugin_macro uses to create ptr to PluginError.
fn construct_error_ptr(plugin_error: swc_core::common::plugin::serialized::PluginError) -> u32 {
let ret = swc_core::common::plugin::serialized::PluginSerializedBytes::try_serialize(&plugin_error).expect("Should able to serialize PluginError");
let ret = swc_core::common::plugin::serialized::PluginSerializedBytes::try_serialize(&swc_core::common::plugin::serialized::VersionedSerializable::new(plugin_error)).expect("Should able to serialize PluginError");
let (ptr, len) = ret.as_ptr();

send_transform_result_to_host(
Expand All @@ -107,7 +107,7 @@ fn handle_func(func: ItemFn, ast_type: Ident) -> TokenStream {
};

let serialized_result = swc_core::common::plugin::serialized::PluginSerializedBytes::try_serialize(
&result
&swc_core::common::plugin::serialized::VersionedSerializable::new(result)
).expect("Diagnostics should be always serializable");

let (serialized_result_ptr, serialized_result_ptr_len) = serialized_result.as_ptr();
Expand Down Expand Up @@ -135,7 +135,7 @@ fn handle_func(func: ItemFn, ast_type: Ident) -> TokenStream {
let err = swc_core::common::plugin::serialized::PluginError::Deserialize("Failed to deserialize program received from host".to_string());
return construct_error_ptr(err);
}
let program: #ast_type = program.expect("Should be a program");
let program: #ast_type = program.expect("Should be a program").into_inner();

// Create a handler wired with plugin's diagnostic emitter, set it for global context.
let handler = swc_core::common::errors::Handler::with_emitter(
Expand All @@ -161,7 +161,7 @@ fn handle_func(func: ItemFn, ast_type: Ident) -> TokenStream {
};

// Take original plugin fn ident, then call it with interop'ed args
let transformed_program = #ident(program, metadata);
let transformed_program = swc_core::common::plugin::serialized::VersionedSerializable::new(#ident(program, metadata));

// Serialize transformed result, return back to the host.
let serialized_result = swc_core::common::plugin::serialized::PluginSerializedBytes::try_serialize(
Expand Down
7 changes: 4 additions & 3 deletions crates/swc_plugin_proxy/src/comments/plugin_comments_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ impl PluginCommentsProxy {
{
#[cfg(target_arch = "wasm32")]
{
let serialized =
swc_common::plugin::serialized::PluginSerializedBytes::try_serialize(&value)
.expect("Should able to serialize value");
let serialized = swc_common::plugin::serialized::PluginSerializedBytes::try_serialize(
&swc_common::plugin::serialized::VersionedSerializable::new(value),
)
.expect("Should able to serialize value");
let (serialized_comment_ptr, serialized_comment_ptr_len) = serialized.as_ptr();
unsafe {
// We need to copy PluginCommentProxy's param for add_leading (Comment, or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ where
F: FnOnce(u32) -> u32,
{
// Allocate AllocatedBytesPtr to get return value from the host
let allocated_bytes_ptr = AllocatedBytesPtr(0, 0);
let allocated_bytes_ptr =
swc_common::plugin::serialized::VersionedSerializable::new(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) =
Expand All @@ -69,6 +70,7 @@ where
.expect("Should able to convert ptr length"),
)
.expect("Should able to deserialize AllocatedBytesPtr")
.into_inner()
})
}

Expand Down Expand Up @@ -98,5 +100,6 @@ where
allocated_returned_value_ptr.1,
)
.expect("Returned value should be serializable")
.into_inner()
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl TransformPluginProgramMetadata {
#[cfg(target_arch = "wasm32")]
return read_returned_result_from_host(|serialized_ptr| unsafe {
let serialized = swc_common::plugin::serialized::PluginSerializedBytes::try_serialize(
&key.to_string(),
&swc_common::plugin::serialized::VersionedSerializable::new(key.to_string()),
)
.expect("Should be serializable");
let (key_ptr, key_ptr_len) = serialized.as_ptr();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,10 @@ impl SourceMapper for PluginSourceMapProxy {
ctxt: swc_common::SyntaxContext::empty(),
};

let serialized =
swc_common::plugin::serialized::PluginSerializedBytes::try_serialize(&span)
.expect("Should be serializable");
let serialized = swc_common::plugin::serialized::PluginSerializedBytes::try_serialize(
&swc_common::plugin::serialized::VersionedSerializable::new(span),
)
.expect("Should be serializable");
let (ptr, len) = serialized.as_ptr();

let ret = __merge_spans_proxy(
Expand Down
6 changes: 4 additions & 2 deletions crates/swc_plugin_runner/benches/ecma_invoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::{

use criterion::{black_box, criterion_group, criterion_main, Bencher, Criterion};
#[cfg(feature = "__rkyv")]
use swc_common::plugin::serialized::PluginSerializedBytes;
use swc_common::plugin::serialized::{PluginSerializedBytes, VersionedSerializable};
use swc_common::{
collections::AHashMap, plugin::metadata::TransformPluginMetadataContext, FileName,
FilePathMapping, Globals, Mark, SourceMap, GLOBALS,
Expand Down Expand Up @@ -62,6 +62,7 @@ fn bench_transform(b: &mut Bencher, plugin_dir: &Path) {
)
.unwrap();

let program = VersionedSerializable::new(program);
let program_ser = PluginSerializedBytes::try_serialize(&program).unwrap();

let mut transform_plugin_executor =
Expand All @@ -82,7 +83,8 @@ fn bench_transform(b: &mut Bencher, plugin_dir: &Path) {
)
.unwrap();

let experimental_metadata: AHashMap<String, String> = AHashMap::default();
let experimental_metadata: VersionedSerializable<AHashMap<String, String>> =
VersionedSerializable::new(AHashMap::default());
let _experimental_metadata =
PluginSerializedBytes::try_serialize(&experimental_metadata)
.expect("Should be a hashmap");
Expand Down
Loading

1 comment on commit bba1fad

@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: bba1fad Previous: cad18fa Ratio
es/full/bugs-1 255070 ns/iter (± 5126) 304392 ns/iter (± 10984) 0.84
es/full/minify/libraries/antd 1284193998 ns/iter (± 20913473) 1676505868 ns/iter (± 25119076) 0.77
es/full/minify/libraries/d3 259174361 ns/iter (± 7593848) 315208200 ns/iter (± 5180031) 0.82
es/full/minify/libraries/echarts 1023820184 ns/iter (± 16726767) 1268978308 ns/iter (± 10157127) 0.81
es/full/minify/libraries/jquery 78514084 ns/iter (± 278090) 92848319 ns/iter (± 813778) 0.85
es/full/minify/libraries/lodash 88771556 ns/iter (± 710417) 107466006 ns/iter (± 1243746) 0.83
es/full/minify/libraries/moment 46123745 ns/iter (± 416089) 53626932 ns/iter (± 275866) 0.86
es/full/minify/libraries/react 16497023 ns/iter (± 72838) 19495309 ns/iter (± 160935) 0.85
es/full/minify/libraries/terser 207858862 ns/iter (± 2908454) 250549052 ns/iter (± 2849593) 0.83
es/full/minify/libraries/three 365030575 ns/iter (± 3352985) 468960328 ns/iter (± 11320174) 0.78
es/full/minify/libraries/typescript 2550999489 ns/iter (± 24026023) 3146500634 ns/iter (± 21885989) 0.81
es/full/minify/libraries/victory 553006804 ns/iter (± 11172866) 708322675 ns/iter (± 15186115) 0.78
es/full/minify/libraries/vue 110412705 ns/iter (± 802921) 134103914 ns/iter (± 1015625) 0.82
es/full/codegen/es3 31172 ns/iter (± 66) 33780 ns/iter (± 105) 0.92
es/full/codegen/es5 31258 ns/iter (± 55) 33920 ns/iter (± 68) 0.92
es/full/codegen/es2015 31150 ns/iter (± 82) 33867 ns/iter (± 63) 0.92
es/full/codegen/es2016 31188 ns/iter (± 83) 33855 ns/iter (± 47) 0.92
es/full/codegen/es2017 31147 ns/iter (± 73) 33906 ns/iter (± 52) 0.92
es/full/codegen/es2018 31169 ns/iter (± 84) 33906 ns/iter (± 81) 0.92
es/full/codegen/es2019 31126 ns/iter (± 80) 33827 ns/iter (± 96) 0.92
es/full/codegen/es2020 31286 ns/iter (± 120) 33794 ns/iter (± 368) 0.93
es/full/all/es3 155084214 ns/iter (± 634133) 184333000 ns/iter (± 3246168) 0.84
es/full/all/es5 147847699 ns/iter (± 707731) 178810255 ns/iter (± 3376832) 0.83
es/full/all/es2015 110344074 ns/iter (± 785617) 139519704 ns/iter (± 2903594) 0.79
es/full/all/es2016 109567495 ns/iter (± 509145) 136987240 ns/iter (± 1676126) 0.80
es/full/all/es2017 108893523 ns/iter (± 557906) 132956349 ns/iter (± 2401595) 0.82
es/full/all/es2018 106573752 ns/iter (± 707219) 130416593 ns/iter (± 2272206) 0.82
es/full/all/es2019 106187291 ns/iter (± 1002460) 129184745 ns/iter (± 1747641) 0.82
es/full/all/es2020 102292956 ns/iter (± 1795840) 118431299 ns/iter (± 1670536) 0.86
es/full/parser 454295 ns/iter (± 5987) 508813 ns/iter (± 8509) 0.89
es/full/base/fixer 18060 ns/iter (± 103) 22818 ns/iter (± 83) 0.79
es/full/base/resolver_and_hygiene 76425 ns/iter (± 154) 86186 ns/iter (± 123) 0.89
serialization of serde 118 ns/iter (± 0) 121 ns/iter (± 0) 0.98
css/minify/libraries/bootstrap 23646279 ns/iter (± 176018) 27533558 ns/iter (± 105366) 0.86
css/visitor/compare/clone 1658924 ns/iter (± 5832) 2149047 ns/iter (± 5997) 0.77
css/visitor/compare/visit_mut_span 1799448 ns/iter (± 5802) 2334896 ns/iter (± 6946) 0.77
css/visitor/compare/visit_mut_span_panic 1863438 ns/iter (± 11411) 2398876 ns/iter (± 6095) 0.78
css/visitor/compare/fold_span 2573728 ns/iter (± 9088) 3123687 ns/iter (± 16481) 0.82
css/visitor/compare/fold_span_panic 2757838 ns/iter (± 12625) 3273450 ns/iter (± 14305) 0.84
css/lexer/bootstrap_5_1_3 4510585 ns/iter (± 4479) 5220225 ns/iter (± 23808) 0.86
css/lexer/foundation_6_7_4 3845095 ns/iter (± 3337) 4395261 ns/iter (± 11074) 0.87
css/lexer/tailwind_3_1_1 719140 ns/iter (± 725) 835463 ns/iter (± 2106) 0.86
css/parser/bootstrap_5_1_3 18385166 ns/iter (± 91426) 21057314 ns/iter (± 149916) 0.87
css/parser/foundation_6_7_4 14753848 ns/iter (± 61169) 16693119 ns/iter (± 81825) 0.88
css/parser/tailwind_3_1_1 2802331 ns/iter (± 2098) 3223065 ns/iter (± 5499) 0.87
es/codegen/colors 329705 ns/iter (± 185743) 327552 ns/iter (± 184975) 1.01
es/codegen/large 1340625 ns/iter (± 736180) 1112312 ns/iter (± 558802) 1.21
es/codegen/with-parser/colors 42535 ns/iter (± 567) 49046 ns/iter (± 178) 0.87
es/codegen/with-parser/large 474349 ns/iter (± 750) 531607 ns/iter (± 1928) 0.89
es/minify/libraries/antd 1146526335 ns/iter (± 20048746) 1473285597 ns/iter (± 22272627) 0.78
es/minify/libraries/d3 225041611 ns/iter (± 3265842) 263110840 ns/iter (± 3871647) 0.86
es/minify/libraries/echarts 909950484 ns/iter (± 11956656) 1124520478 ns/iter (± 25651679) 0.81
es/minify/libraries/jquery 70035095 ns/iter (± 143569) 83842950 ns/iter (± 1603526) 0.84
es/minify/libraries/lodash 80869733 ns/iter (± 515472) 99631817 ns/iter (± 851420) 0.81
es/minify/libraries/moment 40528753 ns/iter (± 155287) 47595528 ns/iter (± 581206) 0.85
es/minify/libraries/react 14966169 ns/iter (± 103416) 17710603 ns/iter (± 215552) 0.85
es/minify/libraries/terser 184831155 ns/iter (± 2045394) 221339513 ns/iter (± 4835437) 0.84
es/minify/libraries/three 315877511 ns/iter (± 7844865) 380403194 ns/iter (± 7878812) 0.83
es/minify/libraries/typescript 2221320827 ns/iter (± 13225107) 2716428880 ns/iter (± 27322095) 0.82
es/minify/libraries/victory 481254983 ns/iter (± 5674515) 589953685 ns/iter (± 13027471) 0.82
es/minify/libraries/vue 101043538 ns/iter (± 2008629) 119791364 ns/iter (± 1175509) 0.84
es/visitor/compare/clone 2000101 ns/iter (± 11474) 2336688 ns/iter (± 19047) 0.86
es/visitor/compare/visit_mut_span 2349314 ns/iter (± 4633) 2720546 ns/iter (± 4356) 0.86
es/visitor/compare/visit_mut_span_panic 2376198 ns/iter (± 9690) 2768894 ns/iter (± 11391) 0.86
es/visitor/compare/fold_span 3416955 ns/iter (± 6575) 3820787 ns/iter (± 7332) 0.89
es/visitor/compare/fold_span_panic 3557127 ns/iter (± 20651) 3942338 ns/iter (± 16054) 0.90
es/lexer/colors 11481 ns/iter (± 34) 12996 ns/iter (± 48) 0.88
es/lexer/angular 5611008 ns/iter (± 2410) 6368000 ns/iter (± 14538) 0.88
es/lexer/backbone 726955 ns/iter (± 370) 784772 ns/iter (± 1114) 0.93
es/lexer/jquery 4093159 ns/iter (± 2514) 4419205 ns/iter (± 3651) 0.93
es/lexer/jquery mobile 6344132 ns/iter (± 26027) 6912720 ns/iter (± 9315) 0.92
es/lexer/mootools 3259476 ns/iter (± 3123) 3470338 ns/iter (± 2237) 0.94
es/lexer/underscore 608199 ns/iter (± 2133) 648943 ns/iter (± 908) 0.94
es/lexer/three 19577265 ns/iter (± 22384) 20938750 ns/iter (± 16924) 0.93
es/lexer/yui 3590398 ns/iter (± 3895) 3869349 ns/iter (± 7133) 0.93
es/parser/colors 25312 ns/iter (± 33) 28657 ns/iter (± 73) 0.88
es/parser/angular 13280711 ns/iter (± 139078) 14876409 ns/iter (± 131776) 0.89
es/parser/backbone 1933982 ns/iter (± 8120) 2153551 ns/iter (± 11796) 0.90
es/parser/jquery 10690869 ns/iter (± 158439) 11733237 ns/iter (± 88948) 0.91
es/parser/jquery mobile 16634100 ns/iter (± 194104) 18596734 ns/iter (± 327318) 0.89
es/parser/mootools 8131956 ns/iter (± 40163) 8856553 ns/iter (± 30884) 0.92
es/parser/underscore 1660243 ns/iter (± 10207) 1819625 ns/iter (± 9251) 0.91
es/parser/three 48044537 ns/iter (± 245441) 53861043 ns/iter (± 862547) 0.89
es/parser/yui 8080525 ns/iter (± 63652) 9059696 ns/iter (± 42716) 0.89
es/preset-env/usage/builtin_type 148356 ns/iter (± 39660) 140398 ns/iter (± 34122) 1.06
es/preset-env/usage/property 15929 ns/iter (± 85) 20172 ns/iter (± 159) 0.79
es/resolver/typescript 92581401 ns/iter (± 1151625) 122249862 ns/iter (± 2960412) 0.76
es/fixer/typescript 67740210 ns/iter (± 646551) 86582820 ns/iter (± 2309090) 0.78
es/hygiene/typescript 137156382 ns/iter (± 1551353) 187281886 ns/iter (± 1438417) 0.73
es/resolver_with_hygiene/typescript 243180807 ns/iter (± 3138938) 339308290 ns/iter (± 1980154) 0.72
es/visitor/base-perf/module_clone 61862 ns/iter (± 277) 81310 ns/iter (± 510) 0.76
es/visitor/base-perf/fold_empty 65123 ns/iter (± 365) 91575 ns/iter (± 300) 0.71
es/visitor/base-perf/fold_noop_impl_all 65874 ns/iter (± 413) 92022 ns/iter (± 432) 0.72
es/visitor/base-perf/fold_noop_impl_vec 65545 ns/iter (± 103) 92481 ns/iter (± 643) 0.71
es/visitor/base-perf/boxing_boxed_clone 51 ns/iter (± 0) 56 ns/iter (± 0) 0.91
es/visitor/base-perf/boxing_unboxed_clone 36 ns/iter (± 0) 41 ns/iter (± 0) 0.88
es/visitor/base-perf/boxing_boxed 107 ns/iter (± 0) 101 ns/iter (± 0) 1.06
es/visitor/base-perf/boxing_unboxed 77 ns/iter (± 0) 78 ns/iter (± 0) 0.99
es/visitor/base-perf/visit_empty 0 ns/iter (± 0)
es/visitor/base-perf/visit_contains_this 2679 ns/iter (± 8) 3510 ns/iter (± 37) 0.76
es/base/parallel/resolver/typescript 3896203858 ns/iter (± 327007318) 6367920777 ns/iter (± 665384861) 0.61
es/base/parallel/hygiene/typescript 1466634410 ns/iter (± 18423068) 2192405186 ns/iter (± 26225131) 0.67
misc/visitors/time-complexity/time 5 108 ns/iter (± 1) 105 ns/iter (± 0) 1.03
misc/visitors/time-complexity/time 10 284 ns/iter (± 0) 321 ns/iter (± 0) 0.88
misc/visitors/time-complexity/time 15 539 ns/iter (± 0) 651 ns/iter (± 4) 0.83
misc/visitors/time-complexity/time 20 1140 ns/iter (± 2) 1185 ns/iter (± 1) 0.96
misc/visitors/time-complexity/time 40 3912 ns/iter (± 326) 6286 ns/iter (± 14) 0.62
misc/visitors/time-complexity/time 60 7731 ns/iter (± 8) 15525 ns/iter (± 39) 0.50
es/full-target/es2016 227624 ns/iter (± 676) 253067 ns/iter (± 1822) 0.90
es/full-target/es2017 217412 ns/iter (± 832) 246683 ns/iter (± 1024) 0.88
es/full-target/es2018 207108 ns/iter (± 764) 235408 ns/iter (± 521) 0.88
es2020_nullish_coalescing 70026 ns/iter (± 450) 93821 ns/iter (± 659) 0.75
es2020_optional_chaining 96962 ns/iter (± 908) 125099 ns/iter (± 432) 0.78
es2022_class_properties 118369 ns/iter (± 292) 149451 ns/iter (± 466) 0.79
es2018_object_rest_spread 74908 ns/iter (± 204) 96624 ns/iter (± 397) 0.78
es2019_optional_catch_binding 64439 ns/iter (± 505) 86632 ns/iter (± 419) 0.74
es2017_async_to_generator 64800 ns/iter (± 471) 86800 ns/iter (± 183) 0.75
es2016_exponentiation 68879 ns/iter (± 185) 91063 ns/iter (± 268) 0.76
es2015_arrow 68589 ns/iter (± 211) 94605 ns/iter (± 254) 0.73
es2015_block_scoped_fn 68224 ns/iter (± 190) 93204 ns/iter (± 372) 0.73
es2015_block_scoping 120184 ns/iter (± 454) 170811 ns/iter (± 510) 0.70

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

Please sign in to comment.