From e20dd403cd5f35bd088e7c6a13ee72ad79b03fac Mon Sep 17 00:00:00 2001 From: "Heres, Daniel" Date: Sun, 28 Feb 2021 11:21:34 +0100 Subject: [PATCH] Add mimalloc as options to benchmarks --- rust/benchmarks/Cargo.toml | 1 + rust/benchmarks/README.md | 4 ++-- rust/benchmarks/src/bin/tpch.rs | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/rust/benchmarks/Cargo.toml b/rust/benchmarks/Cargo.toml index 99655710017..5cdf0f94ac3 100644 --- a/rust/benchmarks/Cargo.toml +++ b/rust/benchmarks/Cargo.toml @@ -38,4 +38,5 @@ structopt = { version = "0.3", default-features = false } tokio = { version = "^1.0", features = ["macros", "rt", "rt-multi-thread"] } futures = "0.3" env_logger = "^0.8" +mimalloc = { version = "0.1", optional = true, default-features = false } snmalloc-rs = {version = "0.2", optional = true, features= ["cache-friendly"] } diff --git a/rust/benchmarks/README.md b/rust/benchmarks/README.md index bb56b75a1bb..7460477db4e 100644 --- a/rust/benchmarks/README.md +++ b/rust/benchmarks/README.md @@ -53,10 +53,10 @@ The benchmark can then be run (assuming the data created from `dbgen` is in `/mn cargo run --release --bin tpch -- benchmark --iterations 3 --path /mnt/tpch-dbgen --format tbl --query 1 --batch-size 4096 ``` -You can enable the features `simd` (to use SIMD instructions) and/or `snmalloc` (to use the snmalloc allocator) as features by passing them in as `--features`: +You can enable the features `simd` (to use SIMD instructions) and/or `mimalloc` or `snmalloc` (to use either the mimalloc or snmalloc allocator) as features by passing them in as `--features`: ``` -cargo run --release --features "simd snmalloc" --bin tpch -- benchmark --iterations 3 --path /mnt/tpch-dbgen --format tbl --query 1 --batch-size 4096 +cargo run --release --features "simd mimalloc" --bin tpch -- benchmark --iterations 3 --path /mnt/tpch-dbgen --format tbl --query 1 --batch-size 4096 ``` The benchmark program also supports CSV and Parquet input file formats and a utility is provided to convert from `tbl` diff --git a/rust/benchmarks/src/bin/tpch.rs b/rust/benchmarks/src/bin/tpch.rs index f0f2e7cf57c..b0a6cedd172 100644 --- a/rust/benchmarks/src/bin/tpch.rs +++ b/rust/benchmarks/src/bin/tpch.rs @@ -40,6 +40,10 @@ use structopt::StructOpt; #[global_allocator] static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc; +#[cfg(feature = "mimalloc")] +#[global_allocator] +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; + #[derive(Debug, StructOpt)] struct BenchmarkOpt { /// Query number