From ec77526a6b4f9c58d9a00194c1e2317c7ef3fff9 Mon Sep 17 00:00:00 2001 From: Astro Date: Mon, 2 Oct 2023 00:00:52 +0200 Subject: [PATCH] butcher/main: use mimalloc --- Cargo.lock | 1 + butcher/Cargo.toml | 1 + butcher/src/main.rs | 3 +++ 3 files changed, 5 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 2c554be..792c06b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -359,6 +359,7 @@ dependencies = [ "metrics", "metrics-exporter-prometheus", "metrics-util", + "mimalloc", "rand", "reqwest", "serde", diff --git a/butcher/Cargo.toml b/butcher/Cargo.toml index 4484875..aef19d0 100644 --- a/butcher/Cargo.toml +++ b/butcher/Cargo.toml @@ -20,3 +20,4 @@ texting_robots = "0.2" metrics = "0.20" metrics-util = "0.14" metrics-exporter-prometheus = "0.11" +mimalloc = { version = "*", default-features = false } diff --git a/butcher/src/main.rs b/butcher/src/main.rs index eb02f07..e2decb1 100644 --- a/butcher/src/main.rs +++ b/butcher/src/main.rs @@ -14,6 +14,9 @@ use trend_setter::UpdateSet; mod config; mod trend_setter; +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + async fn is_profane(profanity: &WordList, post: &Post) -> bool { if post.sensitive == Some(true) { return true;