mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 09:45:31 +00:00
Make mimalloc optional for udp and http
This commit is contained in:
parent
f061c47ef8
commit
7795a1a532
5 changed files with 21 additions and 5 deletions
|
|
@ -18,9 +18,13 @@ name = "aquatic_http"
|
|||
name = "aquatic_http"
|
||||
|
||||
[features]
|
||||
default = ["prometheus"]
|
||||
default = ["prometheus", "mimalloc"]
|
||||
prometheus = ["aquatic_common/prometheus", "metrics", "dep:metrics-util"]
|
||||
metrics = ["dep:metrics"]
|
||||
# Use mimalloc allocator for much better performance.
|
||||
#
|
||||
# Requires cmake and a C compiler
|
||||
mimalloc = ["dep:mimalloc"]
|
||||
|
||||
[dependencies]
|
||||
aquatic_common = { workspace = true, features = ["rustls"] }
|
||||
|
|
@ -40,7 +44,6 @@ httparse = "1"
|
|||
itoa = "1"
|
||||
libc = "0.2"
|
||||
log = "0.4"
|
||||
mimalloc = { version = "0.1", default-features = false }
|
||||
memchr = "2"
|
||||
privdrop = "0.5"
|
||||
once_cell = "1"
|
||||
|
|
@ -56,6 +59,9 @@ thiserror = "1"
|
|||
metrics = { version = "0.22", optional = true }
|
||||
metrics-util = { version = "0.16", optional = true }
|
||||
|
||||
# mimalloc feature
|
||||
mimalloc = { version = "0.1", default-features = false, optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
quickcheck = "1"
|
||||
quickcheck_macros = "1"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
use aquatic_common::cli::run_app_with_cli_and_config;
|
||||
use aquatic_http::config::Config;
|
||||
|
||||
#[cfg(feature = "mimalloc")]
|
||||
#[global_allocator]
|
||||
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue