From 8390cde97da8c3251e91e6653eec5dd2bd550787 Mon Sep 17 00:00:00 2001 From: Gert Hulselmans Date: Thu, 14 Apr 2022 11:47:19 +0200 Subject: [PATCH] Switch from unmaintained jemalloctor to maintained tikv-jemallocator. --- polars/src/lib.rs | 4 +++- py-polars/Cargo.lock | 44 ++++++++++++++++++++++---------------------- py-polars/Cargo.toml | 2 +- py-polars/src/lib.rs | 4 ++-- 4 files changed, 28 insertions(+), 26 deletions(-) diff --git a/polars/src/lib.rs b/polars/src/lib.rs index 38ee3ad06b59..f01d73bc5b81 100644 --- a/polars/src/lib.rs +++ b/polars/src/lib.rs @@ -261,7 +261,9 @@ //! //! ### Custom allocator //! A DataFrame library naturally does a lot of heap allocations. It is recommended to use a custom -//! allocator. [Mimalloc](https://docs.rs/mimalloc/0.1.25/mimalloc/) and [JeMalloc](https://crates.io/crates/jemallocator) for instance, show a significant +//! allocator. +//! [Mimalloc](https://crates.io/crates/mimalloc) and +//! [JeMalloc](https://crates.io/crates/tikv-jemallocator) for instance, show a significant //! performance gain in runtime as well as memory usage. //! //! #### Usage diff --git a/py-polars/Cargo.lock b/py-polars/Cargo.lock index de8dd0f02a08..9b38a4774193 100644 --- a/py-polars/Cargo.lock +++ b/py-polars/Cargo.lock @@ -655,27 +655,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" -[[package]] -name = "jemalloc-sys" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45" -dependencies = [ - "cc", - "fs_extra", - "libc", -] - -[[package]] -name = "jemallocator" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43ae63fcfc45e99ab3d1b29a46782ad679e98436c3169d15a167a1108a724b69" -dependencies = [ - "jemalloc-sys", - "libc", -] - [[package]] name = "jobserver" version = "0.1.24" @@ -1310,7 +1289,6 @@ version = "0.13.22" dependencies = [ "ahash", "bincode", - "jemallocator", "libc", "mimalloc", "ndarray", @@ -1320,6 +1298,7 @@ dependencies = [ "pyo3", "serde_json", "thiserror", + "tikv-jemallocator", ] [[package]] @@ -1692,6 +1671,27 @@ dependencies = [ "syn", ] +[[package]] +name = "tikv-jemalloc-sys" +version = "0.4.3+5.2.1-patched.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1792ccb507d955b46af42c123ea8863668fae24d03721e40cad6a41773dbb49" +dependencies = [ + "cc", + "fs_extra", + "libc", +] + +[[package]] +name = "tikv-jemallocator" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5b7bcecfafe4998587d636f9ae9d55eb9d0499877b88757767c346875067098" +dependencies = [ + "libc", + "tikv-jemalloc-sys", +] + [[package]] name = "time" version = "0.1.43" diff --git a/py-polars/Cargo.toml b/py-polars/Cargo.toml index 49fce9d52ef9..fdcf053cfd93 100644 --- a/py-polars/Cargo.toml +++ b/py-polars/Cargo.toml @@ -19,7 +19,7 @@ description = "Blazingly fast DataFrame library" mimalloc = { version = "*", default-features = false } [target.'cfg(target_os="linux")'.dependencies] -jemallocator = { version = "0.3", features = ["disable_initial_exec_tls"] } +tikv-jemallocator = { version = "0.4", features = ["disable_initial_exec_tls"] } [dependencies] ahash = "0.7" diff --git a/py-polars/src/lib.rs b/py-polars/src/lib.rs index f97b22c4af7f..21513ad246ac 100644 --- a/py-polars/src/lib.rs +++ b/py-polars/src/lib.rs @@ -39,8 +39,6 @@ use crate::error::{ use crate::file::get_either_file; use crate::prelude::{ClosedWindow, DataType, DatetimeArgs, Duration, DurationArgs, PyDataType}; use dsl::ToExprs; -#[cfg(target_os = "linux")] -use jemallocator::Jemalloc; #[cfg(not(target_os = "linux"))] use mimalloc::MiMalloc; use polars::functions::{diag_concat_df, hor_concat_df}; @@ -49,6 +47,8 @@ use polars_core::datatypes::TimeUnit; use polars_core::export::arrow::io::ipc::read::read_file_metadata; use polars_core::prelude::IntoSeries; use pyo3::types::{PyBool, PyDict, PyFloat, PyInt, PyString}; +#[cfg(target_os = "linux")] +use tikv_jemallocator::Jemalloc; #[global_allocator] #[cfg(target_os = "linux")]