Skip to content

Commit

Permalink
Switch from unmaintained jemalloctor to maintained tikv-jemallocator. (
Browse files Browse the repository at this point in the history
  • Loading branch information
ghuls committed Apr 14, 2022
1 parent f164d7b commit 00e5c00
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 26 deletions.
4 changes: 3 additions & 1 deletion polars/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 22 additions & 22 deletions py-polars/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion py-polars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions py-polars/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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")]
Expand Down

0 comments on commit 00e5c00

Please sign in to comment.