Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Enable the jemallocator dependencies only when we are running on linux #249

Merged
merged 2 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ publish = false
[dependencies]
milli = { path = "../milli" }

[target.'cfg(target_os = "linux")'.dependencies]
jemallocator = "0.3.2"

[dev-dependencies]
heed = "*" # we want to use the version milli uses
criterion = { version = "0.3.4", features = ["html_reports"] }
Expand Down
4 changes: 4 additions & 0 deletions benchmarks/benches/songs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ 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;

fn base_conf(builder: &mut Settings) {
let displayed_fields =
["id", "title", "album", "artist", "genre", "country", "released", "duration"]
Expand Down
4 changes: 4 additions & 0 deletions benchmarks/benches/wiki.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ 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;

fn base_conf(builder: &mut Settings) {
let displayed_fields = ["title", "body", "url"].iter().map(|s| s.to_string()).collect();
builder.set_displayed_fields(displayed_fields);
Expand Down
4 changes: 3 additions & 1 deletion helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ edition = "2018"
anyhow = "1.0.38"
byte-unit = { version = "4.0.9", default-features = false, features = ["std"] }
heed = "0.10.6"
jemallocator = "0.3.2"
milli = { path = "../milli" }
stderrlog = "0.5.1"
structopt = { version = "0.3.21", default-features = false }

[target.'cfg(target_os = "linux")'.dependencies]
jemallocator = "0.3.2"
3 changes: 3 additions & 0 deletions http-ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ funty = "=1.1"
[dev-dependencies]
maplit = "1.0.2"
serde_test = "1.0.125"

[target.'cfg(target_os = "linux")'.dependencies]
jemallocator = "0.3.2"
4 changes: 4 additions & 0 deletions http-ui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ use warp::Filter;

use self::update_store::UpdateStore;

#[cfg(target_os = "linux")]
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

static GLOBAL_THREAD_POOL: OnceCell<ThreadPool> = OnceCell::new();

#[derive(Debug, StructOpt)]
Expand Down
4 changes: 3 additions & 1 deletion infos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ anyhow = "1.0.38"
byte-unit = { version = "4.0.9", default-features = false, features = ["std"] }
csv = "1.1.5"
heed = "0.10.6"
jemallocator = "0.3.2"
milli = { path = "../milli" }
roaring = "0.6.6"
serde_json = "1.0.62"
stderrlog = "0.5.1"
structopt = { version = "0.3.21", default-features = false }

[target.'cfg(target_os = "linux")'.dependencies]
jemallocator = "0.3.2"
4 changes: 3 additions & 1 deletion search/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ edition = "2018"
anyhow = "1.0.38"
byte-unit = { version = "4.0.9", default-features = false, features = ["std"] }
heed = "0.10.6"
jemallocator = "0.3.2"
log = "0.4.14"
milli = { path = "../milli" }
serde_json = "1.0.62"
stderrlog = "0.5.1"
structopt = { version = "0.3.21", default-features = false }

[target.'cfg(target_os = "linux")'.dependencies]
jemallocator = "0.3.2"