Skip to content

Commit

Permalink
After extensive benchmarking, move back to Jemalloc.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkorunic committed Nov 6, 2023
1 parent 94f5ef8 commit 4aab427
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "findlargedir"
version = "0.6.0"
version = "0.6.1"
authors = ["Dinko Korunic <[email protected]>"]
categories = ["command-line-utilities"]
description = "find all blackhole directories with a huge amount of filesystem entries in a flat structure"
Expand Down Expand Up @@ -29,13 +29,13 @@ cfg-if = "1.0"
fdlimit = "0.2.1"

[target.'cfg(all(target_os = "linux", target_arch = "x86_64"))'.dependencies]
mimalloc = { version = "0.1.39", default-features = false }
tikv-jemallocator = "0.5.4"

[target.'cfg(all(target_os = "linux", target_arch = "aarch64"))'.dependencies]
mimalloc = { version = "0.1.39", default-features = false }
tikv-jemallocator = "0.5.4"

[target.'cfg(target_os = "macos")'.dependencies]
mimalloc = { version = "0.1.39", default-features = false }
tikv-jemallocator = "0.5.4"

[profile.release]
lto = true
Expand Down
12 changes: 6 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ mod walk;

cfg_if! {
if #[cfg(all(target_os = "linux", target_arch = "x86_64"))] {
use_mimalloc!();
use_jemalloc!();
} else if #[cfg(all(target_os = "linux", target_arch = "aarch64"))] {
use_mimalloc!();
use_jemalloc!();
} else if #[cfg(target_os = "macos")] {
use_mimalloc!();
use_jemalloc!();
}
}

Expand Down Expand Up @@ -122,11 +122,11 @@ fn main() -> Result<(), Error> {
}

#[macro_export]
macro_rules! use_mimalloc {
macro_rules! use_jemalloc {
() => {
use mimalloc::MiMalloc;
use tikv_jemallocator::Jemalloc;

#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;
static GLOBAL: Jemalloc = Jemalloc;
};
}

0 comments on commit 4aab427

Please sign in to comment.