From e4b48499b0fe294b92ffee3c907af7c639a52c42 Mon Sep 17 00:00:00 2001 From: dagou Date: Tue, 24 Sep 2024 19:26:02 +0800 Subject: [PATCH] jemalloc --- Cargo.toml | 3 ++- src/bin/kun.rs | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 9eb630f..e8b4f7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kun_peng" -version = "0.7.1" +version = "0.7.2" edition = "2021" authors = ["eric9n@gmail.com"] description = "Kun-peng: an ultra-fast, low-memory footprint and accurate taxonomy classifier for all" @@ -33,6 +33,7 @@ regex = "1.5.4" flate2 = "1.0" dashmap = { version = "6.0.1", features = ["rayon"] } num_cpus = "1.13.1" +jemallocator = "0.5.4" [dev-dependencies] criterion = "0.5.1" diff --git a/src/bin/kun.rs b/src/bin/kun.rs index dc151a9..1bb2822 100644 --- a/src/bin/kun.rs +++ b/src/bin/kun.rs @@ -17,6 +17,9 @@ use kun_peng::utils::find_files; use std::path::PathBuf; use std::time::Instant; +#[global_allocator] +static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc; + #[derive(Parser, Debug, Clone)] #[clap(author, version, about="build database", long_about = None)] struct BuildArgs {