From 38d862607b03ac767a64215429d95c172549a780 Mon Sep 17 00:00:00 2001 From: Onur Satici Date: Fri, 20 Mar 2026 17:15:42 +0000 Subject: [PATCH 1/2] default mimalloc for vortex-python wheels Signed-off-by: Onur Satici --- Cargo.lock | 1 + vortex-python/Cargo.toml | 5 +++++ vortex-python/pyproject.toml | 2 +- vortex-python/src/lib.rs | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index d3ca1f48c16..41174277ab5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10423,6 +10423,7 @@ dependencies = [ "bytes", "itertools 0.14.0", "log", + "mimalloc", "object_store", "parking_lot", "pyo3", diff --git a/vortex-python/Cargo.toml b/vortex-python/Cargo.toml index 60c1da60b4d..e901db6943f 100644 --- a/vortex-python/Cargo.toml +++ b/vortex-python/Cargo.toml @@ -28,6 +28,10 @@ default = ["extension-module", "tui"] # duplicate PyInit__lib symbols. extension-module = [] tui = ["dep:vortex-tui"] +# Set the default allocator to mimalloc, this is enabled by default +# for the maturin wheels, but it is not a default feature to not conflict +# with users that set a different global allocator. +mimalloc = ["dep:mimalloc"] [dependencies] arrow-array = { workspace = true } @@ -43,6 +47,7 @@ object_store = { workspace = true, features = [ "azure", "http", ] } +mimalloc = { workspace = true, optional = true } parking_lot = { workspace = true } pyo3 = { workspace = true, features = ["abi3", "abi3-py311"] } pyo3-bytes = { workspace = true } diff --git a/vortex-python/pyproject.toml b/vortex-python/pyproject.toml index e9699dee4fd..9e962667bf4 100644 --- a/vortex-python/pyproject.toml +++ b/vortex-python/pyproject.toml @@ -59,7 +59,7 @@ managed = true [tool.maturin] python-source = "python" module-name = "vortex._lib" -features = ["pyo3/extension-module"] +features = ["pyo3/extension-module", "mimalloc"] compatibility = "manylinux2014" include = [ { path = "rust-toolchain.toml", format = "sdist" }, diff --git a/vortex-python/src/lib.rs b/vortex-python/src/lib.rs index 1d6bd678a26..be399ea8d6e 100644 --- a/vortex-python/src/lib.rs +++ b/vortex-python/src/lib.rs @@ -1,6 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +#[cfg(feature = "mimalloc")] +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + use std::ops::Deref; use std::sync::LazyLock; From 9378c6b9784aa811dfa5506f3e58c681999eef62 Mon Sep 17 00:00:00 2001 From: Onur Satici Date: Fri, 20 Mar 2026 17:40:54 +0000 Subject: [PATCH 2/2] taplo Signed-off-by: Onur Satici --- vortex-python/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vortex-python/Cargo.toml b/vortex-python/Cargo.toml index e901db6943f..7a606495c7d 100644 --- a/vortex-python/Cargo.toml +++ b/vortex-python/Cargo.toml @@ -40,6 +40,7 @@ arrow-schema = { workspace = true } bytes = { workspace = true } itertools = { workspace = true } log = { workspace = true } +mimalloc = { workspace = true, optional = true } object_store = { workspace = true, features = [ "fs", "aws", @@ -47,7 +48,6 @@ object_store = { workspace = true, features = [ "azure", "http", ] } -mimalloc = { workspace = true, optional = true } parking_lot = { workspace = true } pyo3 = { workspace = true, features = ["abi3", "abi3-py311"] } pyo3-bytes = { workspace = true }