mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
ws: add mimalloc feature to make it easier to disable it
This commit is contained in:
parent
3042539101
commit
6e7d36cffc
3 changed files with 8 additions and 5 deletions
|
|
@ -18,9 +18,12 @@ name = "aquatic_ws"
|
|||
name = "aquatic_ws"
|
||||
|
||||
[features]
|
||||
default = ["prometheus"]
|
||||
default = ["prometheus", "mimalloc"]
|
||||
prometheus = ["metrics", "metrics-exporter-prometheus"]
|
||||
metrics = ["dep:metrics", "metrics-util"]
|
||||
# Use mimalloc allocator for much better performance. Requires cmake and a
|
||||
# C/C++ compiler
|
||||
mimalloc = ["dep:mimalloc"]
|
||||
|
||||
[dependencies]
|
||||
aquatic_common = { workspace = true, features = ["rustls", "glommio"] }
|
||||
|
|
@ -43,7 +46,7 @@ log = "0.4"
|
|||
metrics = { version = "0.22", optional = true }
|
||||
metrics-util = { version = "0.16", optional = true }
|
||||
metrics-exporter-prometheus = { version = "0.13", optional = true, default-features = false, features = ["http-listener"] }
|
||||
mimalloc = { version = "0.1", default-features = false }
|
||||
mimalloc = { version = "0.1", default-features = false, optional = true }
|
||||
privdrop = "0.5"
|
||||
rand = { version = "0.8", features = ["small_rng"] }
|
||||
rustls = "0.22"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
use aquatic_common::cli::run_app_with_cli_and_config;
|
||||
use aquatic_ws::config::Config;
|
||||
|
||||
// #[global_allocator]
|
||||
// static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
#[cfg(feature = "mimalloc")]
|
||||
#[global_allocator]
|
||||
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
|
||||
fn main() {
|
||||
run_app_with_cli_and_config::<Config>(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue