Skip to content

Commit

Permalink
perf: Tune jemalloc to not create muzzy pages (pola-rs#18148)
Browse files Browse the repository at this point in the history
  • Loading branch information
orlp authored Aug 12, 2024
1 parent 8c19d18 commit fac700d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[env]
# Tune jemalloc (https://github.com/pola-rs/polars/issues/18088).
JEMALLOC_SYS_WITH_MALLOC_CONF = "dirty_decay_ms:500,muzzy_decay_ms:-1"
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ __pycache__/
.coverage

# Rust
.cargo/
target/

# Data
Expand Down
6 changes: 5 additions & 1 deletion py-polars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ built = { version = "0.7", features = ["chrono", "git2", "cargo-lock"], optional
[target.'cfg(all(any(not(target_family = "unix"), allocator = "mimalloc"), not(allocator = "default")))'.dependencies]
mimalloc = { version = "0.1", default-features = false }

[target.'cfg(all(target_family = "unix", not(allocator = "mimalloc"), not(allocator = "default")))'.dependencies]
# 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(allocator = "mimalloc"), not(allocator = "default")))'.dependencies]
jemallocator = { version = "0.5", 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"] }

[features]
Expand Down

0 comments on commit fac700d

Please sign in to comment.