perf(node/swc): Use mimalloc (#2068)

This commit is contained in:
LongYinan 2021-08-13 17:39:13 +08:00 committed by GitHub
parent c6dce67494
commit fe2a063525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 101 additions and 117 deletions

151
Cargo.lock generated
View File

@ -27,12 +27,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "ahash"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e"
[[package]] [[package]]
name = "ahash" name = "ahash"
version = "0.7.4" version = "0.7.4"
@ -157,9 +151,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.2.1" version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" checksum = "2da1976d75adbe5fbc88130ecd119529cf1cc6a93ae1546d8696ee66f0d21af1"
[[package]] [[package]]
name = "block-buffer" name = "block-buffer"
@ -318,9 +312,9 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-deque" name = "crossbeam-deque"
version = "0.8.0" version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if 1.0.0",
"crossbeam-epoch", "crossbeam-epoch",
@ -366,6 +360,12 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "cty"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7313c0d620d0cb4dbd9d019e461a4beb501071ff46ec0ab933efb4daa76d73e3"
[[package]] [[package]]
name = "darling" name = "darling"
version = "0.10.2" version = "0.10.2"
@ -541,12 +541,6 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "fs_extra"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"
[[package]] [[package]]
name = "fuchsia-cprng" name = "fuchsia-cprng"
version = "0.1.1" version = "0.1.1"
@ -674,20 +668,14 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "hashbrown"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
dependencies = [
"ahash 0.4.7",
]
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.11.2" version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
dependencies = [
"ahash",
]
[[package]] [[package]]
name = "hermit-abi" name = "hermit-abi"
@ -814,7 +802,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
dependencies = [ dependencies = [
"autocfg 1.0.1", "autocfg 1.0.1",
"hashbrown 0.11.2", "hashbrown",
"rayon", "rayon",
] ]
@ -843,27 +831,6 @@ version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"
[[package]]
name = "jemalloc-sys"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45"
dependencies = [
"cc",
"fs_extra",
"libc",
]
[[package]]
name = "jemallocator"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43ae63fcfc45e99ab3d1b29a46782ad679e98436c3169d15a167a1108a724b69"
dependencies = [
"jemalloc-sys",
"libc",
]
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.49" version = "0.3.49"
@ -920,18 +887,9 @@ dependencies = [
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.98" version = "0.2.99"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790" checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765"
[[package]]
name = "libmimalloc-sys"
version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d1b8479c593dba88c2741fc50b92e13dbabbbe0bd504d979f244ccc1a5b1c01"
dependencies = [
"cc",
]
[[package]] [[package]]
name = "lock_api" name = "lock_api"
@ -954,18 +912,18 @@ dependencies = [
[[package]] [[package]]
name = "lru" name = "lru"
version = "0.6.5" version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f374d42cdfc1d7dbf3d3dec28afab2eb97ffbf43a3234d795b5986dbf4b90ba" checksum = "7ea2d928b485416e8908cff2d97d621db22b27f7b3b6729e438bcf42c671ba91"
dependencies = [ dependencies = [
"hashbrown 0.9.1", "hashbrown",
] ]
[[package]] [[package]]
name = "matches" name = "matches"
version = "0.1.8" version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
[[package]] [[package]]
name = "maybe-uninit" name = "maybe-uninit"
@ -989,12 +947,23 @@ dependencies = [
] ]
[[package]] [[package]]
name = "mimalloc" name = "mimalloc-rust"
version = "0.1.26" version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb74897ce508e6c49156fd1476fc5922cbc6e75183c65e399c765a09122e5130" checksum = "2ffcd5c93c5b59f49b89b58100fad6ea023dbec6f9344f0d0932a96d9497821a"
dependencies = [ dependencies = [
"libmimalloc-sys", "cty",
"mimalloc-rust-sys",
]
[[package]]
name = "mimalloc-rust-sys"
version = "1.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96f7f32dcc7aeb79781116048bbd27cc819b9db55805690b3379d536d40e9590"
dependencies = [
"cc",
"cty",
] ]
[[package]] [[package]]
@ -1072,9 +1041,9 @@ checksum = "43563506c466587478849d80f46383d859b91bbec586580dadeb3639588f2f7e"
[[package]] [[package]]
name = "native-tls" name = "native-tls"
version = "0.2.7" version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4" checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
"libc", "libc",
@ -1760,9 +1729,9 @@ dependencies = [
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.2.9" version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"
dependencies = [ dependencies = [
"bitflags", "bitflags",
] ]
@ -1786,9 +1755,9 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
[[package]] [[package]]
name = "relative-path" name = "relative-path"
version = "1.4.0" version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a479d53d7eed831f3c92ca79c61002d5987e21417d528296832f802bca532380" checksum = "f9629de8974fd69c97684736786b807edd3da456d3e3f95341dd9d4cbd8f5ad6"
[[package]] [[package]]
name = "remove_dir_all" name = "remove_dir_all"
@ -1938,18 +1907,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.126" version = "1.0.127"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.126" version = "1.0.127"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1958,9 +1927,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.64" version = "1.0.66"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127"
dependencies = [ dependencies = [
"itoa", "itoa",
"ryu", "ryu",
@ -2010,9 +1979,9 @@ checksum = "729a25c17d72b06c68cb47955d44fda88ad2d3e7d77e025663fdd69b93dd71a1"
[[package]] [[package]]
name = "slab" name = "slab"
version = "0.4.3" version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590"
[[package]] [[package]]
name = "smallvec" name = "smallvec"
@ -2169,7 +2138,7 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c"
name = "swc" name = "swc"
version = "0.40.0" version = "0.40.0"
dependencies = [ dependencies = [
"ahash 0.7.4", "ahash",
"anyhow", "anyhow",
"base64 0.13.0", "base64 0.13.0",
"dashmap", "dashmap",
@ -2228,7 +2197,7 @@ dependencies = [
name = "swc_babel_compat" name = "swc_babel_compat"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"ahash 0.7.4", "ahash",
"anyhow", "anyhow",
"copyless", "copyless",
"pretty_assertions 0.7.2", "pretty_assertions 0.7.2",
@ -2264,7 +2233,7 @@ dependencies = [
name = "swc_bundler" name = "swc_bundler"
version = "0.52.0" version = "0.52.0"
dependencies = [ dependencies = [
"ahash 0.7.4", "ahash",
"anyhow", "anyhow",
"crc", "crc",
"dashmap", "dashmap",
@ -2789,8 +2758,7 @@ name = "swc_node_base"
version = "0.2.0" version = "0.2.0"
dependencies = [ dependencies = [
"dashmap", "dashmap",
"jemallocator", "mimalloc-rust",
"mimalloc",
"swc_common", "swc_common",
] ]
@ -2913,9 +2881,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.9.0" version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b7b349f11a7047e6d1276853e612d152f5e8a352c61917887cc2169e2366b4c" checksum = "01cf844b23c6131f624accf65ce0e4e9956a8bb329400ea5bcc26ae3a5c20b0b"
dependencies = [ dependencies = [
"autocfg 1.0.1", "autocfg 1.0.1",
"bytes", "bytes",
@ -3000,12 +2968,9 @@ checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06"
[[package]] [[package]]
name = "unicode-bidi" name = "unicode-bidi"
version = "0.3.5" version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085"
dependencies = [
"matches",
]
[[package]] [[package]]
name = "unicode-normalization" name = "unicode-normalization"

View File

@ -1,4 +1,5 @@
#![feature(test)] #![feature(test)]
#![feature(bench_black_box)]
extern crate test; extern crate test;

View File

@ -74,6 +74,8 @@ fn fixtures() -> Result<(), Error> {
ignore: false, ignore: false,
should_panic: ShouldPanic::No, should_panic: ShouldPanic::No,
allow_fail: false, allow_fail: false,
compile_fail: false,
no_run: false,
}, },
testfn: DynTestFn(Box::alloc().init(move || { testfn: DynTestFn(Box::alloc().init(move || {
let syntax = if is_typescript { let syntax = if is_typescript {

View File

@ -1,4 +1,5 @@
#![feature(test)] #![feature(test)]
#![feature(bench_black_box)]
extern crate test; extern crate test;

View File

@ -44,6 +44,8 @@ fn add_test<F: FnOnce() + Send + 'static>(
ignore, ignore,
should_panic: No, should_panic: No,
allow_fail: false, allow_fail: false,
compile_fail: false,
no_run: false,
}, },
testfn: DynTestFn(Box::new(f)), testfn: DynTestFn(Box::new(f)),
}); });

View File

@ -1,4 +1,5 @@
#![feature(test)] #![feature(test)]
#![feature(bench_black_box)]
extern crate test; extern crate test;

View File

@ -185,7 +185,6 @@ impl<'a> DiagnosticBuilder<'a> {
msg: &str, msg: &str,
) -> &mut Self); ) -> &mut Self);
#[deprecated(note = "Use `span_suggestion_short_with_applicability`")]
forward!(pub fn span_suggestion_short( forward!(pub fn span_suggestion_short(
&mut self, &mut self,
sp: Span, sp: Span,
@ -193,21 +192,18 @@ impl<'a> DiagnosticBuilder<'a> {
suggestion: String, suggestion: String,
) -> &mut Self); ) -> &mut Self);
#[deprecated(note = "Use `multipart_suggestion_with_applicability`")]
forward!(pub fn multipart_suggestion( forward!(pub fn multipart_suggestion(
&mut self, &mut self,
msg: &str, msg: &str,
suggestion: Vec<(Span, String)>, suggestion: Vec<(Span, String)>,
) -> &mut Self); ) -> &mut Self);
#[deprecated(note = "Use `span_suggestion_with_applicability`")]
forward!(pub fn span_suggestion(&mut self, forward!(pub fn span_suggestion(&mut self,
sp: Span, sp: Span,
msg: &str, msg: &str,
suggestion: String, suggestion: String,
) -> &mut Self); ) -> &mut Self);
#[deprecated(note = "Use `span_suggestions_with_applicability`")]
forward!(pub fn span_suggestions(&mut self, forward!(pub fn span_suggestions(&mut self,
sp: Span, sp: Span,
msg: &str, msg: &str,

View File

@ -1,4 +1,5 @@
#![feature(test)] #![feature(test)]
#![feature(bench_black_box)]
extern crate test; extern crate test;

View File

@ -1,4 +1,5 @@
#![feature(test)] #![feature(test)]
#![feature(bench_black_box)]
extern crate test; extern crate test;

View File

@ -26,10 +26,10 @@ macro_rules! emit {
macro_rules! keyword { macro_rules! keyword {
($emitter:expr, $span:expr, $s:expr) => { ($emitter:expr, $span:expr, $s:expr) => {
$emitter.wr.write_keyword(Some($span), $s)?; $emitter.wr.write_keyword(Some($span), $s)?
}; };
($emitter:expr, $s:expr) => { ($emitter:expr, $s:expr) => {
$emitter.wr.write_keyword(None, $s)?; $emitter.wr.write_keyword(None, $s)?
}; };
} }
@ -42,10 +42,10 @@ macro_rules! punct {
}; };
($emitter:expr, ";") => { ($emitter:expr, ";") => {
$emitter.wr.write_semi(None)?; $emitter.wr.write_semi(None)?
}; };
($emitter:expr, $s:expr) => { ($emitter:expr, $s:expr) => {
$emitter.wr.write_punct(None, $s)?; $emitter.wr.write_punct(None, $s)?
}; };
} }
@ -61,7 +61,7 @@ macro_rules! operator {
macro_rules! space { macro_rules! space {
($emitter:expr) => { ($emitter:expr) => {
$emitter.wr.write_space()?; $emitter.wr.write_space()?
}; };
($emitter:expr,) => { ($emitter:expr,) => {
space!($emitter) space!($emitter)

View File

@ -1,4 +1,5 @@
#![feature(test)] #![feature(test)]
#![feature(bench_black_box)]
extern crate test; extern crate test;
@ -84,6 +85,8 @@ fn add_test<F: FnOnce() + Send + 'static>(
ignore, ignore,
should_panic: No, should_panic: No,
allow_fail: false, allow_fail: false,
compile_fail: false,
no_run: false,
}, },
testfn: DynTestFn(Box::new(f)), testfn: DynTestFn(Box::new(f)),
}); });

View File

@ -1,4 +1,5 @@
#![feature(test)] #![feature(test)]
#![feature(bench_black_box)]
extern crate test; extern crate test;
@ -27,6 +28,8 @@ fn add_test<F: FnOnce() + Send + 'static>(
ignore, ignore,
should_panic: No, should_panic: No,
allow_fail: false, allow_fail: false,
compile_fail: false,
no_run: false,
}, },
testfn: DynTestFn(Box::new(f)), testfn: DynTestFn(Box::new(f)),
}); });

View File

@ -1,4 +1,5 @@
#![feature(test)] #![feature(test)]
#![feature(bench_black_box)]
extern crate test; extern crate test;

View File

@ -105,6 +105,7 @@
#![cfg_attr(test, feature(test))] #![cfg_attr(test, feature(test))]
#![deny(unused)] #![deny(unused)]
#![feature(bench_black_box)]
pub use self::{ pub use self::{
lexer::input::{Input, StringInput}, lexer::input::{Input, StringInput},

View File

@ -33,6 +33,8 @@ fn add_test<F: FnOnce() + Send + 'static>(
ignore, ignore,
should_panic: No, should_panic: No,
allow_fail: false, allow_fail: false,
compile_fail: false,
no_run: false,
}, },
testfn: DynTestFn(Box::new(f)), testfn: DynTestFn(Box::new(f)),
}); });

View File

@ -29,6 +29,8 @@ fn add_test<F: FnOnce() + Send + 'static>(
ignore, ignore,
should_panic: No, should_panic: No,
allow_fail: false, allow_fail: false,
compile_fail: false,
no_run: false,
}, },
testfn: DynTestFn(Box::new(f)), testfn: DynTestFn(Box::new(f)),
}); });

View File

@ -93,6 +93,8 @@ fn add_test<F: FnOnce() + Send + 'static>(
ignore, ignore,
should_panic: No, should_panic: No,
allow_fail: false, allow_fail: false,
compile_fail: false,
no_run: false,
}, },
testfn: DynTestFn(Box::new(f)), testfn: DynTestFn(Box::new(f)),
}); });

View File

@ -160,6 +160,8 @@ fn load() -> Result<Vec<TestDescAndFn>, Error> {
name: TestName::DynTestName(name), name: TestName::DynTestName(name),
allow_fail: false, allow_fail: false,
should_panic: ShouldPanic::No, should_panic: ShouldPanic::No,
compile_fail: false,
no_run: false,
}, },
testfn: TestFn::DynTestFn(Box::new(move || { testfn: TestFn::DynTestFn(Box::new(move || {
// //

View File

@ -104,6 +104,8 @@ fn add_test<F: FnOnce() + Send + 'static>(
ignore, ignore,
should_panic: No, should_panic: No,
allow_fail: false, allow_fail: false,
compile_fail: false,
no_run: false,
}, },
testfn: DynTestFn(Box::new(f)), testfn: DynTestFn(Box::new(f)),
}); });

View File

@ -33,6 +33,8 @@ fn add_test<F: FnOnce() + Send + 'static>(
ignore, ignore,
should_panic: No, should_panic: No,
allow_fail: false, allow_fail: false,
compile_fail: false,
no_run: false,
}, },
testfn: DynTestFn(Box::new(f)), testfn: DynTestFn(Box::new(f)),
}); });

View File

@ -14,8 +14,5 @@ version = "0.2.0"
dashmap = "4.0.2" dashmap = "4.0.2"
swc_common = {version = "0.11.0", path = "../../common"} swc_common = {version = "0.11.0", path = "../../common"}
[target.'cfg(all(unix, not(target_env = "musl"), not(target_os = "freebsd"), not(target_arch = "arm"), not(target_arch = "aarch64")))'.dependencies] [target.'cfg(all(target_arch = "x86_64", not(target_env = "musl")))'.dependencies]
jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]} mimalloc-rust = "0.1"
[target.'cfg(all(windows, not(target_arch = "aarch64")))'.dependencies]
mimalloc = {version = "0.1"}

View File

@ -3,15 +3,9 @@
//! The swc crates related to the node binding should depend on this crate. //! The swc crates related to the node binding should depend on this crate.
#[cfg(all( #[cfg(all(
unix, target_arch = "x86_64",
not(target_env = "musl"), not(target_env = "musl"),
not(target_os = "freebsd"), not(debug_assertions)
not(target_arch = "arm"),
not(target_arch = "aarch64")
))] ))]
#[global_allocator] #[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; static ALLOC: mimalloc_rust::GlobalMiMalloc = mimalloc_rust::GlobalMiMalloc;
#[cfg(all(windows, not(target_arch = "aarch64")))]
#[global_allocator]
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;

View File

@ -1 +1 @@
nightly-2021-03-25 nightly-2021-08-12

View File

@ -1,6 +1,7 @@
//! This benchmark lives here because I don't want to implement `Resolve` again //! This benchmark lives here because I don't want to implement `Resolve` again
//! and again. //! and again.
#![feature(test)] #![feature(test)]
#![feature(bench_black_box)]
extern crate test; extern crate test;

View File

@ -42,6 +42,8 @@ fn add_test<F: FnOnce() + Send + 'static>(
ignore, ignore,
should_panic: No, should_panic: No,
allow_fail: false, allow_fail: false,
compile_fail: false,
no_run: false,
}, },
testfn: DynTestFn(Box::new(f)), testfn: DynTestFn(Box::new(f)),
}); });