From c42bce4842b756266a3ab2a05ff0f0986b911c8c Mon Sep 17 00:00:00 2001 From: Tatsunori Uchino Date: Wed, 20 Nov 2024 20:03:54 +0900 Subject: [PATCH] Replace jemalloc with mimalloc --- charabia/Cargo.toml | 4 +--- charabia/benches/bench.rs | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/charabia/Cargo.toml b/charabia/Cargo.toml index 7e53a3a..936ef36 100644 --- a/charabia/Cargo.toml +++ b/charabia/Cargo.toml @@ -81,9 +81,7 @@ german-segmentation = [] criterion = "0.5" quickcheck = "1" quickcheck_macros = "1" - -[target.'cfg(any(all(target_os = "linux", any(target_arch = "x86_64", target_arch = "aarch64", all(target_arch = "powerpc64", target_endian = "little"))), all(target_os = "macos", target_arch = "aarch64")))'.dev-dependencies] -jemallocator = "0.5.4" +mimalloc = "0.1.43" [[bench]] name = "bench" diff --git a/charabia/benches/bench.rs b/charabia/benches/bench.rs index d1ef7b2..7f2b17f 100644 --- a/charabia/benches/bench.rs +++ b/charabia/benches/bench.rs @@ -1,9 +1,9 @@ use charabia::{Language, Script, Segment, Tokenize}; use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion}; +use mimalloc::MiMalloc; -#[cfg(any(all(target_os = "linux", any(target_arch = "x86_64", target_arch = "aarch64", all(target_arch = "powerpc64", target_endian = "little"))), all(target_os = "macos", target_arch = "aarch64")))] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static GLOBAL: MiMalloc = MiMalloc; static DATA_SET: &[((usize, Script, Language), &str)] = &[ // short texts (~130 bytes)