mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 10:37:41 +08:00
Use mimalloc for benchmarks on macOS
This commit is contained in:
parent
950d8e4c44
commit
8f73251012
@ -13,6 +13,10 @@ csv = "1.1.6"
|
|||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
jemallocator = "0.3.2"
|
jemallocator = "0.3.2"
|
||||||
|
|
||||||
|
[target.'cfg(target_os = "macos")'.dependencies]
|
||||||
|
mimalloc = { version = "0.1.29", default-features = false }
|
||||||
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1" }
|
heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1" }
|
||||||
criterion = { version = "0.3.5", features = ["html_reports"] }
|
criterion = { version = "0.3.5", features = ["html_reports"] }
|
||||||
|
@ -6,6 +6,10 @@ use milli::{FormatOptions, MatcherBuilder, MatchingWord, MatchingWords};
|
|||||||
#[global_allocator]
|
#[global_allocator]
|
||||||
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
#[global_allocator]
|
||||||
|
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||||
|
|
||||||
struct Conf<'a> {
|
struct Conf<'a> {
|
||||||
name: &'a str,
|
name: &'a str,
|
||||||
text: &'a str,
|
text: &'a str,
|
||||||
|
@ -18,6 +18,10 @@ use roaring::RoaringBitmap;
|
|||||||
#[global_allocator]
|
#[global_allocator]
|
||||||
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
#[global_allocator]
|
||||||
|
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||||
|
|
||||||
const BENCHMARK_ITERATION: usize = 10;
|
const BENCHMARK_ITERATION: usize = 10;
|
||||||
|
|
||||||
fn setup_dir(path: impl AsRef<Path>) {
|
fn setup_dir(path: impl AsRef<Path>) {
|
||||||
|
@ -9,6 +9,10 @@ use utils::Conf;
|
|||||||
#[global_allocator]
|
#[global_allocator]
|
||||||
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
#[global_allocator]
|
||||||
|
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||||
|
|
||||||
fn base_conf(builder: &mut Settings) {
|
fn base_conf(builder: &mut Settings) {
|
||||||
let displayed_fields =
|
let displayed_fields =
|
||||||
["geonameid", "name", "asciiname", "alternatenames", "_geo", "population"]
|
["geonameid", "name", "asciiname", "alternatenames", "_geo", "population"]
|
||||||
|
@ -9,6 +9,10 @@ use utils::Conf;
|
|||||||
#[global_allocator]
|
#[global_allocator]
|
||||||
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
#[global_allocator]
|
||||||
|
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||||
|
|
||||||
fn base_conf(builder: &mut Settings) {
|
fn base_conf(builder: &mut Settings) {
|
||||||
let displayed_fields =
|
let displayed_fields =
|
||||||
["id", "title", "album", "artist", "genre", "country", "released", "duration"]
|
["id", "title", "album", "artist", "genre", "country", "released", "duration"]
|
||||||
|
@ -9,6 +9,10 @@ use utils::Conf;
|
|||||||
#[global_allocator]
|
#[global_allocator]
|
||||||
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
#[global_allocator]
|
||||||
|
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||||
|
|
||||||
fn base_conf(builder: &mut Settings) {
|
fn base_conf(builder: &mut Settings) {
|
||||||
let displayed_fields = ["title", "body", "url"].iter().map(|s| s.to_string()).collect();
|
let displayed_fields = ["title", "body", "url"].iter().map(|s| s.to_string()).collect();
|
||||||
builder.set_displayed_fields(displayed_fields);
|
builder.set_displayed_fields(displayed_fields);
|
||||||
|
Loading…
Reference in New Issue
Block a user