Skip to content

Commit

Permalink
chore: Use tikv-jemallocator (#21486)
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnherfst authored Feb 28, 2025
1 parent 4e4d259 commit e8ee335
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
42 changes: 21 additions & 21 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions crates/polars/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,13 @@
//! ### Custom allocator
//! An OLAP query engine does a lot of heap allocations. It is recommended to use a custom
//! allocator, (we have found this to have up to ~25% runtime influence).
//! [JeMalloc](https://crates.io/crates/jemallocator) and
//! [JeMalloc](https://crates.io/crates/tikv-jemallocator) and
//! [Mimalloc](https://crates.io/crates/mimalloc) for instance, show a significant
//! performance gain in runtime as well as memory usage.
//!
//! #### Jemalloc Usage
//! ```ignore
//! use jemallocator::Jemalloc;
//! use tikv_jemallocator::Jemalloc;
//!
//! #[global_allocator]
//! static GLOBAL: Jemalloc = Jemalloc;
Expand All @@ -340,7 +340,7 @@
//! #### Cargo.toml
//! ```toml
//! [dependencies]
//! jemallocator = { version = "*" }
//! tikv-jemallocator = { version = "*" }
//! ```
//!
//! #### Mimalloc Usage
Expand Down
4 changes: 2 additions & 2 deletions py-polars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ mimalloc = { version = "0.1", default-features = false }

# Feature background_threads is unsupported on MacOS (https://github.com/jemalloc/jemalloc/issues/843).
[target.'cfg(all(target_family = "unix", not(target_os = "macos"), not(target_os = "emscripten"), not(allocator = "mimalloc"), not(allocator = "default")))'.dependencies]
jemallocator = { version = "0.5", features = ["disable_initial_exec_tls", "background_threads"] }
tikv-jemallocator = { version = "0.6.0", features = ["disable_initial_exec_tls", "background_threads"] }

[target.'cfg(all(target_family = "unix", target_os = "macos", not(allocator = "mimalloc"), not(allocator = "default")))'.dependencies]
jemallocator = { version = "0.5", features = ["disable_initial_exec_tls"] }
tikv-jemallocator = { version = "0.6.0", features = ["disable_initial_exec_tls"] }
either = { workspace = true }

[features]
Expand Down
2 changes: 1 addition & 1 deletion py-polars/src/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
target_family = "unix",
not(target_os = "emscripten"),
))]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

#[global_allocator]
#[cfg(all(
Expand Down

0 comments on commit e8ee335

Please sign in to comment.