diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index 896ccd739..600525372 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -5,17 +5,15 @@ edition = "2018" publish = false [dependencies] -milli = { path = "../milli" } anyhow = "1.0.56" -serde_json = { version = "1.0.79", features = ["preserve_order"] } csv = "1.1.6" - -[target.'cfg(target_os = "linux")'.dependencies] -jemallocator = "0.3.2" +milli = { path = "../milli" } +mimalloc = { version = "0.1.29", default-features = false } +serde_json = { version = "1.0.79", features = ["preserve_order"] } [dev-dependencies] -heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1" } criterion = { version = "0.3.5", features = ["html_reports"] } +heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1" } rand = "0.8.5" rand_chacha = "0.3.1" roaring = "0.9.0" @@ -23,8 +21,8 @@ roaring = "0.9.0" [build-dependencies] anyhow = "1.0.56" bytes = "1.1.0" -flate2 = "1.0.22" convert_case = "0.5.0" +flate2 = "1.0.22" reqwest = { version = "0.11.9", features = ["blocking", "rustls-tls"], default-features = false } [[bench]] diff --git a/benchmarks/benches/formatting.rs b/benchmarks/benches/formatting.rs index f0ef8ea15..25c5a0ba8 100644 --- a/benchmarks/benches/formatting.rs +++ b/benchmarks/benches/formatting.rs @@ -2,9 +2,8 @@ use criterion::{criterion_group, criterion_main}; use milli::tokenizer::TokenizerBuilder; use milli::{FormatOptions, MatcherBuilder, MatchingWord, MatchingWords}; -#[cfg(target_os = "linux")] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; struct Conf<'a> { name: &'a str, diff --git a/benchmarks/benches/indexing.rs b/benchmarks/benches/indexing.rs index c756583e6..d532c85d9 100644 --- a/benchmarks/benches/indexing.rs +++ b/benchmarks/benches/indexing.rs @@ -14,9 +14,8 @@ use rand::seq::SliceRandom; use rand_chacha::rand_core::SeedableRng; use roaring::RoaringBitmap; -#[cfg(target_os = "linux")] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; const BENCHMARK_ITERATION: usize = 10; diff --git a/benchmarks/benches/search_geo.rs b/benchmarks/benches/search_geo.rs index 84448c32d..faea4e3e0 100644 --- a/benchmarks/benches/search_geo.rs +++ b/benchmarks/benches/search_geo.rs @@ -5,9 +5,8 @@ use criterion::{criterion_group, criterion_main}; use milli::update::Settings; use utils::Conf; -#[cfg(target_os = "linux")] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; fn base_conf(builder: &mut Settings) { let displayed_fields = diff --git a/benchmarks/benches/search_songs.rs b/benchmarks/benches/search_songs.rs index 6b11799ec..a1245528f 100644 --- a/benchmarks/benches/search_songs.rs +++ b/benchmarks/benches/search_songs.rs @@ -5,9 +5,8 @@ use criterion::{criterion_group, criterion_main}; use milli::update::Settings; use utils::Conf; -#[cfg(target_os = "linux")] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; fn base_conf(builder: &mut Settings) { let displayed_fields = diff --git a/benchmarks/benches/search_wiki.rs b/benchmarks/benches/search_wiki.rs index 9ef75efeb..b792c2645 100644 --- a/benchmarks/benches/search_wiki.rs +++ b/benchmarks/benches/search_wiki.rs @@ -5,9 +5,8 @@ use criterion::{criterion_group, criterion_main}; use milli::update::Settings; use utils::Conf; -#[cfg(target_os = "linux")] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; fn base_conf(builder: &mut Settings) { let displayed_fields = ["title", "body", "url"].iter().map(|s| s.to_string()).collect(); diff --git a/cli/Cargo.toml b/cli/Cargo.toml index e4de70031..504df712e 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -6,18 +6,16 @@ description = "A CLI to interact with a milli index" publish = false [dependencies] +bimap = "0.6.2" +byte-unit = { version = "4.0.14", features = ["serde"] } +color-eyre = "0.6.1" +csv = "1.1.6" +eyre = "0.6.7" +heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1", default-features = false, features = ["lmdb", "sync-read-txn"] } indicatif = "0.16.2" +milli = { path = "../milli" } +mimalloc = { version = "0.1.29", default-features = false } serde = "1.0.136" serde_json = "1.0.79" -structopt = "0.3.26" -milli = { path = "../milli" } -eyre = "0.6.7" -color-eyre = "0.6.1" -heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1", default-features = false, features = ["lmdb", "sync-read-txn"] } -byte-unit = { version = "4.0.14", features = ["serde"] } -bimap = "0.6.2" -csv = "1.1.6" stderrlog = "0.5.1" - -[target.'cfg(target_os = "linux")'.dependencies] -jemallocator = "0.3.2" +structopt = "0.3.26" diff --git a/cli/src/main.rs b/cli/src/main.rs index 35fef95c6..8485560f5 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -16,9 +16,8 @@ use milli::update::{self, IndexDocumentsConfig, IndexDocumentsMethod, IndexerCon use milli::{Index, Object}; use structopt::StructOpt; -#[cfg(target_os = "linux")] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; #[derive(Debug, StructOpt)] #[structopt(name = "Milli CLI", about = "A simple CLI to manipulate a milli index.")] diff --git a/helpers/Cargo.toml b/helpers/Cargo.toml index 46c50de43..bd09574f3 100644 --- a/helpers/Cargo.toml +++ b/helpers/Cargo.toml @@ -11,8 +11,6 @@ anyhow = "1.0.56" byte-unit = { version = "4.0.14", default-features = false, features = ["std"] } heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1" } milli = { path = "../milli" } +mimalloc = { version = "0.1.29", default-features = false } stderrlog = "0.5.1" structopt = { version = "0.3.26", default-features = false } - -[target.'cfg(target_os = "linux")'.dependencies] -jemallocator = "0.3.2" diff --git a/helpers/src/main.rs b/helpers/src/main.rs index b325aef89..0081965ad 100644 --- a/helpers/src/main.rs +++ b/helpers/src/main.rs @@ -5,9 +5,8 @@ use heed::{CompactionOption, Env, EnvOpenOptions}; use structopt::StructOpt; use Command::*; -#[cfg(target_os = "linux")] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; #[derive(Debug, StructOpt)] /// Some helpers commands for milli. diff --git a/http-ui/Cargo.toml b/http-ui/Cargo.toml index 43e046c11..993818f93 100644 --- a/http-ui/Cargo.toml +++ b/http-ui/Cargo.toml @@ -13,6 +13,7 @@ crossbeam-channel = "0.5.2" heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1" } memmap2 = "0.5.3" milli = { path = "../milli" } +mimalloc = { version = "0.1.29", default-features = false } once_cell = "1.10.0" rayon = "1.5.1" structopt = { version = "0.3.26", default-features = false, features = ["wrap_help"] } @@ -32,18 +33,16 @@ tokio-stream = { version = "0.1.8", default-features = false, features = ["sync" warp = "0.3.2" # logging +fst = "0.4.7" log = "0.4.14" stderrlog = "0.5.1" -fst = "0.4.7" # Temporary fix for bitvec, remove once fixed. (https://github.com/bitvecto-rs/bitvec/issues/105) -funty = "2.0.0" bimap = "0.6.2" csv = "1.1.6" +funty = "2.0.0" [dev-dependencies] maplit = "1.0.2" serde_test = "1.0.136" -[target.'cfg(target_os = "linux")'.dependencies] -jemallocator = "0.3.2" diff --git a/http-ui/src/main.rs b/http-ui/src/main.rs index 83fce9a9c..de5d3c5ab 100644 --- a/http-ui/src/main.rs +++ b/http-ui/src/main.rs @@ -42,9 +42,8 @@ use warp::Filter; use self::update_store::UpdateStore; -#[cfg(target_os = "linux")] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; static GLOBAL_CONFIG: OnceCell = OnceCell::new(); diff --git a/infos/Cargo.toml b/infos/Cargo.toml index ea1ee9193..8c92ae649 100644 --- a/infos/Cargo.toml +++ b/infos/Cargo.toml @@ -11,10 +11,8 @@ byte-unit = { version = "4.0.14", default-features = false, features = ["std"] } csv = "1.1.6" heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1" } milli = { path = "../milli" } +mimalloc = { version = "0.1.29", default-features = false } roaring = "0.9.0" serde_json = "1.0.79" stderrlog = "0.5.1" structopt = { version = "0.3.26", default-features = false } - -[target.'cfg(target_os = "linux")'.dependencies] -jemallocator = "0.3.2" diff --git a/infos/src/main.rs b/infos/src/main.rs index feec17557..2862fed7a 100644 --- a/infos/src/main.rs +++ b/infos/src/main.rs @@ -11,9 +11,8 @@ use milli::{FieldId, Index}; use structopt::StructOpt; use Command::*; -#[cfg(target_os = "linux")] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; const ALL_DATABASE_NAMES: &[&str] = &[ MAIN, diff --git a/milli/fuzz/Cargo.toml b/milli/fuzz/Cargo.toml index e734936fb..7e1bea3c5 100644 --- a/milli/fuzz/Cargo.toml +++ b/milli/fuzz/Cargo.toml @@ -16,9 +16,7 @@ serde_json = { version = "1.0.62", features = ["preserve_order"] } anyhow = "1.0" tempfile = "3.3" arbitrary-json = "0.1.0" - -[target.'cfg(target_os = "linux")'.dependencies] -jemallocator = "0.3.2" +mimalloc = { version = "0.1.29", default-features = false } [dependencies.milli] path = ".." diff --git a/milli/fuzz/fuzz_targets/indexing.rs b/milli/fuzz/fuzz_targets/indexing.rs index e4f42655e..a447aebe2 100644 --- a/milli/fuzz/fuzz_targets/indexing.rs +++ b/milli/fuzz/fuzz_targets/indexing.rs @@ -12,9 +12,8 @@ use milli::update::{IndexDocuments, IndexDocumentsConfig, IndexerConfig, Setting use milli::Index; use serde_json::{Map, Value}; -#[cfg(target_os = "linux")] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; /// reads json from input and write an obkv batch to writer. pub fn read_json(input: impl Read, writer: impl Write + Seek) -> Result {