Skip to content

Commit

Permalink
chore: Reduce compile time (#2909)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 authored Nov 29, 2021
1 parent 586ab0c commit 435facc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
34 changes: 28 additions & 6 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ rustdocflags = [
rustflags = [
"-C",
"target-feature=+sse2",
"-Z",
"new-llvm-pass-manager=no",
]

[target.aarch64-apple-darwin]
rustflags = []
rustflags = [
"-Z",
"new-llvm-pass-manager=no",
]

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
rustflags = []
rustflags = [
"-Z",
"new-llvm-pass-manager=no",
]

[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
Expand All @@ -24,17 +32,31 @@ rustflags = [
"target-feature=-crt-static",
"-C",
"link-arg=-lgcc",
"-Z",
"new-llvm-pass-manager=no",
]

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
rustflags = []
rustflags = [
"-Z",
"new-llvm-pass-manager=no",
]

[target.aarch64-linux-android]
rustflags = []
rustflags = [
"-Z",
"new-llvm-pass-manager=no",
]

[target.aarch64-pc-windows-msvc]
rustflags = []
rustflags = [
"-Z",
"new-llvm-pass-manager=no",
]

[target.wasm32-unknown-unknown]
rustflags = []
rustflags = [
"-Z",
"new-llvm-pass-manager=no",
]
3 changes: 3 additions & 0 deletions crates/swc_ecma_visit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ where
}
}

/// The returned folder only handles `fold_script` and `fold_module`, and
/// typescript nodes are ignored. So if your visitor needs to handle typescript
/// or low-level nodes, you should use [as_folder] instead.
#[inline]
pub fn as_folder<V>(v: V) -> Folder<V>
where
Expand Down

1 comment on commit 435facc

@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: 435facc Previous: 586ab0c Ratio
base_tr_fixer 26274 ns/iter (± 640) 27531 ns/iter (± 3506) 0.95
base_tr_resolver_and_hygiene 154411 ns/iter (± 40548) 146691 ns/iter (± 23103) 1.05
codegen_es2015 59933 ns/iter (± 1974) 47949 ns/iter (± 10353) 1.25
codegen_es2016 59829 ns/iter (± 391) 49899 ns/iter (± 16614) 1.20
codegen_es2017 60035 ns/iter (± 436) 51250 ns/iter (± 20911) 1.17
codegen_es2018 59936 ns/iter (± 338) 54816 ns/iter (± 19974) 1.09
codegen_es2019 59919 ns/iter (± 1273) 52231 ns/iter (± 6928) 1.15
codegen_es2020 59823 ns/iter (± 3296) 51059 ns/iter (± 7727) 1.17
codegen_es3 59779 ns/iter (± 2326) 50364 ns/iter (± 14586) 1.19
codegen_es5 60206 ns/iter (± 1873) 51925 ns/iter (± 11329) 1.16
full_es2015 215125720 ns/iter (± 6893041) 173975022 ns/iter (± 10588745) 1.24
full_es2016 169657200 ns/iter (± 9788508) 139209004 ns/iter (± 10958174) 1.22
full_es2017 182698442 ns/iter (± 14033807) 140686063 ns/iter (± 18962285) 1.30
full_es2018 179534438 ns/iter (± 20035556) 144981008 ns/iter (± 16370360) 1.24
full_es2019 178807961 ns/iter (± 12573482) 140236426 ns/iter (± 14235890) 1.28
full_es2020 177334565 ns/iter (± 14003432) 141153350 ns/iter (± 16556041) 1.26
full_es3 253625730 ns/iter (± 23043213) 202264926 ns/iter (± 24860507) 1.25
full_es5 234980308 ns/iter (± 19987185) 185969504 ns/iter (± 16174450) 1.26
parser 786866 ns/iter (± 59224) 647534 ns/iter (± 131289) 1.22
ser_ast_node 183 ns/iter (± 4) 143 ns/iter (± 34) 1.28
ser_serde 184 ns/iter (± 14) 144 ns/iter (± 32) 1.28
emit_colors 21056448 ns/iter (± 28250847) 15307435 ns/iter (± 20501719) 1.38
emit_large 103312987 ns/iter (± 160288924) 95902559 ns/iter (± 145852500) 1.08
base_clone 2864744 ns/iter (± 507771) 2243505 ns/iter (± 159482) 1.28
fold_span 4554653 ns/iter (± 913582) 3813714 ns/iter (± 392527) 1.19
fold_span_panic 4881840 ns/iter (± 919107) 4058072 ns/iter (± 408660) 1.20
visit_mut_span 3559787 ns/iter (± 746024) 2742690 ns/iter (± 419849) 1.30
visit_mut_span_panic 3551256 ns/iter (± 678979) 2776788 ns/iter (± 247947) 1.28
ast_clone 20462 ns/iter (± 1195) 20087 ns/iter (± 1533) 1.02
ast_clone_to_stable 59851 ns/iter (± 4007) 62530 ns/iter (± 11487) 0.96
ast_clone_to_stable_then_to_unstable 108950 ns/iter (± 11371) 105442 ns/iter (± 19293) 1.03
json_deserialize 2260988 ns/iter (± 181371) 2061640 ns/iter (± 177277) 1.10
json_serialize 110949 ns/iter (± 3326) 87040 ns/iter (± 6990) 1.27
boxing_boxed 148 ns/iter (± 10) 142 ns/iter (± 34) 1.04
boxing_boxed_clone 80 ns/iter (± 8) 62 ns/iter (± 15) 1.29
boxing_unboxed 130 ns/iter (± 16) 147 ns/iter (± 28) 0.88
boxing_unboxed_clone 74 ns/iter (± 9) 61 ns/iter (± 21) 1.21
time_10 385 ns/iter (± 4) 284 ns/iter (± 52) 1.36
time_15 888 ns/iter (± 20) 603 ns/iter (± 174) 1.47
time_20 1464 ns/iter (± 68) 1048 ns/iter (± 143) 1.40
time_40 4837 ns/iter (± 129) 4057 ns/iter (± 706) 1.19
time_5 125 ns/iter (± 17) 91 ns/iter (± 20) 1.37
time_60 10231 ns/iter (± 162) 8624 ns/iter (± 887) 1.19

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

Please sign in to comment.