Skip to content

Commit

Permalink
fix: Revert #2766 (#2774)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 authored Nov 17, 2021
1 parent e03af45 commit 95e7f4d
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions crates/swc_ecma_transforms_compat/src/es2017/async_to_generator.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::{iter, mem::replace};
use swc_common::{util::take::Take, BytePos, Mark, Span, Spanned, SyntaxContext, DUMMY_SP};
use swc_common::{util::take::Take, Mark, Span, Spanned, DUMMY_SP};
use swc_ecma_ast::*;
use swc_ecma_transforms_base::{helper, perf::Check};
use swc_ecma_transforms_macros::fast_path;
Expand Down Expand Up @@ -429,28 +429,9 @@ impl VisitMut for Actual {
})
};

let func_span_lo = {
let key_span_lo = match &prop.key {
PropName::Ident(ident) => ident.span().lo(),
PropName::Str(str) => str.span().lo(),
PropName::Num(num) => num.span().lo(),
PropName::Computed(computed) => computed.span().lo(),
PropName::BigInt(bigint) => bigint.span().lo(),
};

// sub length of "async " from prop's key span
key_span_lo - BytePos(6)
};

let func_span = Span::new(
func_span_lo,
func_span_lo + BytePos(1), // dummy pos
SyntaxContext::empty(),
);

prop.function = Function {
params: original_fn_params,
span: func_span,
span: prop_method_span,
is_async: false,
is_generator: false,
body: Some(BlockStmt {
Expand Down

1 comment on commit 95e7f4d

@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: 95e7f4d Previous: ddfc7e6 Ratio
base_tr_fixer 23438 ns/iter (± 164) 30512 ns/iter (± 3712) 0.77
base_tr_resolver_and_hygiene 128381 ns/iter (± 25485) 180847 ns/iter (± 22035) 0.71
codegen_es2015 51194 ns/iter (± 268) 63344 ns/iter (± 16513) 0.81
codegen_es2016 51307 ns/iter (± 326) 63739 ns/iter (± 5210) 0.80
codegen_es2017 51723 ns/iter (± 243) 64158 ns/iter (± 13140) 0.81
codegen_es2018 51530 ns/iter (± 291) 61324 ns/iter (± 6888) 0.84
codegen_es2019 51409 ns/iter (± 267) 62470 ns/iter (± 10523) 0.82
codegen_es2020 51483 ns/iter (± 166) 63093 ns/iter (± 5669) 0.82
codegen_es3 51354 ns/iter (± 361) 62132 ns/iter (± 11707) 0.83
codegen_es5 51487 ns/iter (± 354) 62427 ns/iter (± 12827) 0.82
full_es2015 182261128 ns/iter (± 8166424) 220666982 ns/iter (± 20271557) 0.83
full_es2016 140901706 ns/iter (± 5213296) 170988815 ns/iter (± 13483924) 0.82
full_es2017 148319929 ns/iter (± 6482813) 182854249 ns/iter (± 31450064) 0.81
full_es2018 147188642 ns/iter (± 6128497) 182000630 ns/iter (± 17537020) 0.81
full_es2019 145437603 ns/iter (± 6504873) 180502044 ns/iter (± 21133980) 0.81
full_es2020 144523187 ns/iter (± 6539038) 180503881 ns/iter (± 27290393) 0.80
full_es3 211548704 ns/iter (± 18022009) 275222220 ns/iter (± 72162327) 0.77
full_es5 200159867 ns/iter (± 12308810) 256186026 ns/iter (± 44495548) 0.78
parser 646533 ns/iter (± 25196) 842002 ns/iter (± 320395) 0.77
ser_ast_node 144 ns/iter (± 6) 178 ns/iter (± 19) 0.81
ser_serde 159 ns/iter (± 6) 196 ns/iter (± 24) 0.81
emit_colors 18646465 ns/iter (± 24298374) 19060238 ns/iter (± 22639978) 0.98
emit_large 117651772 ns/iter (± 176155215) 98856654 ns/iter (± 143815782) 1.19
base_clone 2252749 ns/iter (± 38899) 3047992 ns/iter (± 679324) 0.74
fold_span 3804266 ns/iter (± 241069) 5124571 ns/iter (± 919512) 0.74
fold_span_panic 4065114 ns/iter (± 302073) 4991137 ns/iter (± 883039) 0.81
visit_mut_span 2787697 ns/iter (± 104209) 5355039 ns/iter (± 2163489) 0.52
visit_mut_span_panic 2840809 ns/iter (± 84251) 5382532 ns/iter (± 880909) 0.53
ast_clone 16738 ns/iter (± 159) 23657 ns/iter (± 2955) 0.71
ast_clone_to_stable 50460 ns/iter (± 475) 73062 ns/iter (± 6716) 0.69
ast_clone_to_stable_then_to_unstable 91904 ns/iter (± 468) 132972 ns/iter (± 20605) 0.69
json_deserialize 1924534 ns/iter (± 4696) 2493953 ns/iter (± 538910) 0.77
json_serialize 92726 ns/iter (± 254) 109436 ns/iter (± 32947) 0.85
boxing_boxed 143 ns/iter (± 0) 163 ns/iter (± 21) 0.88
boxing_boxed_clone 68 ns/iter (± 0) 77 ns/iter (± 13) 0.88
boxing_unboxed 140 ns/iter (± 0) 181 ns/iter (± 34) 0.77
boxing_unboxed_clone 63 ns/iter (± 0) 77 ns/iter (± 10) 0.82

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

Please sign in to comment.