Skip to content

Commit

Permalink
Replace jemalloc with mimalloc (#350)
Browse files Browse the repository at this point in the history
* Replace jemalloc with mimalloc

* use mimalloc for job runner
  • Loading branch information
aumetra authored Sep 18, 2023
1 parent 2e0bd1d commit 7eee8ef
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 30 deletions.
44 changes: 22 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions kitsune-job-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ deadpool-redis = "0.12.0"
just-retry = { path = "../lib/just-retry" }
kitsune-core = { path = "../crates/kitsune-core" }
kitsune-db = { path = "../crates/kitsune-db" }
mimalloc = "0.1.39"
tokio = { version = "1.32.0", features = ["full"] }
toml = "0.8.0"
tracing = "0.1.37"
Expand Down
3 changes: 3 additions & 0 deletions kitsune-job-runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ use kitsune_core::{config::Configuration, consts::VERSION};
use std::path::PathBuf;
use tokio::fs;

#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

/// Dedicated Kitsune job runner
#[derive(Parser)]
#[command(about, author, version = VERSION)]
Expand Down
4 changes: 1 addition & 3 deletions kitsune-search-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ dotenvy = "0.15.7"
envy = "0.4.2"
futures-util = "0.3.28"
human-size = { version = "0.4.3", features = ["serde"] }
tikv-jemallocator = { version = "0.5.4", default-features = false, features = [
"background_threads",
] }
kitsune-search-proto = { path = "proto" }
metrics = "0.21.1"
metrics-exporter-prometheus = "0.12.1"
metrics-tracing-context = "0.14.0"
metrics-util = "0.15.1"
mimalloc = "0.1.39"
prost = "0.12.1"
serde = { version = "1.0.188", features = ["derive"] }
tantivy = "0.21.0"
Expand Down
2 changes: 1 addition & 1 deletion kitsune-search-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use tracing::metadata::LevelFilter;
use tracing_subscriber::{filter::Targets, layer::SubscriberExt, Layer as _, Registry};

#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

const STARTUP_FIGLET: &str = r#"
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
Expand Down
4 changes: 1 addition & 3 deletions kitsune/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ http = "0.2.9"
human-panic = "1.2.0"
hyper = { version = "0.14.27", features = ["deprecated"] }
iso8601-timestamp = "0.2.11"
mimalloc = "0.1.39"
mime = "0.3.17"
mime_guess = { version = "2.0.4", default-features = false }
pkcs8 = "0.10.2"
tikv-jemallocator = { version = "0.5.4", default-features = false, features = [
"background_threads",
] }
kitsune-cache = { path = "../crates/kitsune-cache" }
kitsune-captcha = { path = "../crates/kitsune-captcha" }
kitsune-core = { path = "../crates/kitsune-core" }
Expand Down
2 changes: 1 addition & 1 deletion kitsune/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use tracing_subscriber::{filter::Targets, layer::SubscriberExt, Layer, Registry}
use url::Url;

#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

fn install_handlers() -> eyre::Result<()> {
let (eyre_panic_hook, eyre_hook) = HookBuilder::new().into_hooks();
Expand Down

0 comments on commit 7eee8ef

Please sign in to comment.