mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-02-05 00:24:52 +00:00
Use mimalloc as memory allocator (#5378)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
parent
5fcf166a89
commit
1d0a47460d
3 changed files with 25 additions and 0 deletions
20
Cargo.lock
generated
20
Cargo.lock
generated
|
@ -2832,6 +2832,7 @@ dependencies = [
|
||||||
"lemmy_federate",
|
"lemmy_federate",
|
||||||
"lemmy_routes",
|
"lemmy_routes",
|
||||||
"lemmy_utils",
|
"lemmy_utils",
|
||||||
|
"mimalloc",
|
||||||
"reqwest-middleware",
|
"reqwest-middleware",
|
||||||
"reqwest-tracing",
|
"reqwest-tracing",
|
||||||
"rustls 0.23.21",
|
"rustls 0.23.21",
|
||||||
|
@ -2935,6 +2936,16 @@ version = "0.2.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa"
|
checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libmimalloc-sys"
|
||||||
|
version = "0.1.39"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "23aa6811d3bd4deb8a84dde645f943476d13b248d818edcf8ce0b2f37f036b44"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linked-hash-map"
|
name = "linked-hash-map"
|
||||||
version = "0.5.6"
|
version = "0.5.6"
|
||||||
|
@ -3225,6 +3236,15 @@ dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "mimalloc"
|
||||||
|
version = "0.1.43"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "68914350ae34959d83f732418d51e2427a794055d0b9529f48259ac07af65633"
|
||||||
|
dependencies = [
|
||||||
|
"libmimalloc-sys",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mime"
|
name = "mime"
|
||||||
version = "0.3.17"
|
version = "0.3.17"
|
||||||
|
|
|
@ -180,3 +180,4 @@ serde_json = { workspace = true }
|
||||||
rustls = { workspace = true }
|
rustls = { workspace = true }
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
clap = { workspace = true }
|
clap = { workspace = true }
|
||||||
|
mimalloc = "0.1.43"
|
||||||
|
|
|
@ -52,6 +52,7 @@ use lemmy_utils::{
|
||||||
settings::{structs::Settings, SETTINGS},
|
settings::{structs::Settings, SETTINGS},
|
||||||
VERSION,
|
VERSION,
|
||||||
};
|
};
|
||||||
|
use mimalloc::MiMalloc;
|
||||||
use reqwest_middleware::ClientBuilder;
|
use reqwest_middleware::ClientBuilder;
|
||||||
use reqwest_tracing::TracingMiddleware;
|
use reqwest_tracing::TracingMiddleware;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
@ -59,6 +60,9 @@ use std::{ops::Deref, time::Duration};
|
||||||
use tokio::signal::unix::SignalKind;
|
use tokio::signal::unix::SignalKind;
|
||||||
use tracing_actix_web::{DefaultRootSpanBuilder, TracingLogger};
|
use tracing_actix_web::{DefaultRootSpanBuilder, TracingLogger};
|
||||||
|
|
||||||
|
#[global_allocator]
|
||||||
|
static GLOBAL: MiMalloc = MiMalloc;
|
||||||
|
|
||||||
/// Timeout for HTTP requests while sending activities. A longer timeout provides better
|
/// Timeout for HTTP requests while sending activities. A longer timeout provides better
|
||||||
/// compatibility with other ActivityPub software that might allocate more time for synchronous
|
/// compatibility with other ActivityPub software that might allocate more time for synchronous
|
||||||
/// processing of incoming activities. This timeout should be slightly longer than the time we
|
/// processing of incoming activities. This timeout should be slightly longer than the time we
|
||||||
|
|
Loading…
Reference in a new issue