Skip to content

Apache DataFusion SQL Query Engine

Mimalloc (#1878)

Matthew Turner8d2168386df7
diff --git a/datafusion-cli/Cargo.toml b/datafusion-cli/Cargo.toml
index 0f80f28e8f..b04ff152b5 100644
--- a/datafusion-cli/Cargo.toml
+++ b/datafusion-cli/Cargo.toml
@@ -34,4 +34,5 @@ tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync"
datafusion = { path = "../datafusion", version = "7.0.0" }
arrow = { version = "9.0.0" }
ballista = { path = "../ballista/rust/client", version = "0.6.0", optional=true }
-env_logger = "0.9"
\ No newline at end of file
+env_logger = "0.9"
+mimalloc = { version = "*", default-features = false }
\ No newline at end of file
diff --git a/datafusion-cli/src/main.rs b/datafusion-cli/src/main.rs
index 470d8cac88..1d91f13665 100644
--- a/datafusion-cli/src/main.rs
+++ b/datafusion-cli/src/main.rs
@@ -22,11 +22,15 @@ use datafusion_cli::{
context::Context, exec, print_format::PrintFormat, print_options::PrintOptions,
DATAFUSION_CLI_VERSION,
};
+use mimalloc::MiMalloc;
use std::env;
use std::fs::File;
use std::io::BufReader;
use std::path::Path;
+#[global_allocator]
+static GLOBAL: MiMalloc = MiMalloc;
+
#[derive(Debug, Parser, PartialEq)]
#[clap(author, version, about, long_about= None)]
struct Args {