diff --git a/integration-tests/Cargo.lock b/integration-tests/Cargo.lock index 782b0401c..9c906af2d 100644 --- a/integration-tests/Cargo.lock +++ b/integration-tests/Cargo.lock @@ -1669,6 +1669,7 @@ dependencies = [ "config", "hex", "hotpath", + "mimalloc", "serde", "stratum-apps", "tokio", @@ -1759,6 +1760,16 @@ version = "0.2.180" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" +[[package]] +name = "libmimalloc-sys" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "667f4fec20f29dfc6bc7357c582d91796c169ad7e2fce709468aefeb2c099870" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "libredox" version = "0.1.12" @@ -1817,6 +1828,15 @@ version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +[[package]] +name = "mimalloc" +version = "0.1.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1ee66a4b64c74f4ef288bcbb9192ad9c3feaad75193129ac8509af543894fd8" +dependencies = [ + "libmimalloc-sys", +] + [[package]] name = "mime" version = "0.3.17" @@ -2209,6 +2229,7 @@ dependencies = [ "config", "hex", "hotpath", + "mimalloc", "serde", "stratum-apps", "tokio", @@ -3257,6 +3278,7 @@ dependencies = [ "dashmap", "hex", "hotpath", + "mimalloc", "serde", "serde_json", "stratum-apps", diff --git a/miner-apps/Cargo.lock b/miner-apps/Cargo.lock index 89290e32c..be638d435 100644 --- a/miner-apps/Cargo.lock +++ b/miner-apps/Cargo.lock @@ -1529,6 +1529,7 @@ dependencies = [ "config", "hex", "hotpath", + "mimalloc", "serde", "stratum-apps", "tokio", @@ -1576,6 +1577,16 @@ version = "0.2.180" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" +[[package]] +name = "libmimalloc-sys" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "667f4fec20f29dfc6bc7357c582d91796c169ad7e2fce709468aefeb2c099870" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "libredox" version = "0.1.12" @@ -1634,6 +1645,15 @@ version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +[[package]] +name = "mimalloc" +version = "0.1.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1ee66a4b64c74f4ef288bcbb9192ad9c3feaad75193129ac8509af543894fd8" +dependencies = [ + "libmimalloc-sys", +] + [[package]] name = "mime" version = "0.3.17" @@ -2880,6 +2900,7 @@ dependencies = [ "dashmap", "hex", "hotpath", + "mimalloc", "serde", "serde_json", "sha2 0.10.9", diff --git a/miner-apps/jd-client/Cargo.toml b/miner-apps/jd-client/Cargo.toml index ace64d8e7..a0548dc0d 100644 --- a/miner-apps/jd-client/Cargo.toml +++ b/miner-apps/jd-client/Cargo.toml @@ -26,6 +26,7 @@ clap = { version = "4.5.39", features = ["derive"] } bitcoin_core_sv2 = { path = "../../bitcoin-core-sv2" } hex = "0.4.3" hotpath = "0.9" +mimalloc = "0.1.48" [features] hotpath = ["hotpath/hotpath"] diff --git a/miner-apps/jd-client/src/main.rs b/miner-apps/jd-client/src/main.rs index e00542f10..7a621e06d 100644 --- a/miner-apps/jd-client/src/main.rs +++ b/miner-apps/jd-client/src/main.rs @@ -2,6 +2,13 @@ use jd_client_sv2::JobDeclaratorClient; use stratum_apps::config_helpers::logging::init_logging; use crate::args::process_cli_args; +#[cfg(not(feature = "hotpath-alloc"))] +use mimalloc::MiMalloc; + +// Add mimalloc +#[cfg(not(feature = "hotpath-alloc"))] +#[global_allocator] +static GLOBAL: MiMalloc = MiMalloc; mod args; diff --git a/miner-apps/translator/Cargo.toml b/miner-apps/translator/Cargo.toml index 076a2c94a..f79d39547 100644 --- a/miner-apps/translator/Cargo.toml +++ b/miner-apps/translator/Cargo.toml @@ -31,6 +31,7 @@ clap = { version = "4.5.39", features = ["derive"] } hex = "0.4.3" hotpath = "0.9" dashmap = "6.1.0" +mimalloc = "0.1.48" [features] hotpath = ["hotpath/hotpath"] diff --git a/miner-apps/translator/src/main.rs b/miner-apps/translator/src/main.rs index c5320872b..0d6dcdeb3 100644 --- a/miner-apps/translator/src/main.rs +++ b/miner-apps/translator/src/main.rs @@ -3,6 +3,13 @@ use stratum_apps::config_helpers::logging::init_logging; pub use translator_sv2::{config, error, status, sv1, sv2, TranslatorSv2}; use crate::args::process_cli_args; +#[cfg(not(feature = "hotpath-alloc"))] +use mimalloc::MiMalloc; + +// Add mimalloc +#[cfg(not(feature = "hotpath-alloc"))] +#[global_allocator] +static GLOBAL: MiMalloc = MiMalloc; #[cfg(all(feature = "hotpath-alloc", not(test)))] #[tokio::main(flavor = "current_thread")] diff --git a/pool-apps/Cargo.lock b/pool-apps/Cargo.lock index a714de256..81a0f0ad4 100644 --- a/pool-apps/Cargo.lock +++ b/pool-apps/Cargo.lock @@ -1537,6 +1537,16 @@ version = "0.2.180" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" +[[package]] +name = "libmimalloc-sys" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "667f4fec20f29dfc6bc7357c582d91796c169ad7e2fce709468aefeb2c099870" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "libredox" version = "0.1.12" @@ -1595,6 +1605,15 @@ version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +[[package]] +name = "mimalloc" +version = "0.1.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1ee66a4b64c74f4ef288bcbb9192ad9c3feaad75193129ac8509af543894fd8" +dependencies = [ + "libmimalloc-sys", +] + [[package]] name = "mime" version = "0.3.17" @@ -1895,6 +1914,7 @@ dependencies = [ "config", "hex", "hotpath", + "mimalloc", "serde", "stratum-apps", "tokio", diff --git a/pool-apps/pool/Cargo.toml b/pool-apps/pool/Cargo.toml index 619dc79ae..4f5e410e2 100644 --- a/pool-apps/pool/Cargo.toml +++ b/pool-apps/pool/Cargo.toml @@ -27,6 +27,7 @@ clap = { version = "4.5.39", features = ["derive"] } bitcoin_core_sv2 = { path = "../../bitcoin-core-sv2" } hex = "0.4.3" hotpath = "0.9" +mimalloc = "0.1.48" [features] hotpath = ["hotpath/hotpath"] diff --git a/pool-apps/pool/src/main.rs b/pool-apps/pool/src/main.rs index 0c2cc9b0d..5192a68a2 100644 --- a/pool-apps/pool/src/main.rs +++ b/pool-apps/pool/src/main.rs @@ -3,6 +3,14 @@ use stratum_apps::config_helpers::logging::init_logging; use crate::args::process_cli_args; +#[cfg(not(feature = "hotpath-alloc"))] +use mimalloc::MiMalloc; + +// Add mimalloc +#[cfg(not(feature = "hotpath-alloc"))] +#[global_allocator] +static GLOBAL: MiMalloc = MiMalloc; + mod args; #[cfg(all(feature = "hotpath-alloc", not(test)))]