Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- Optional **jemalloc** global allocator behind the `jemalloc` Cargo feature (#402).
Off by default; enable with `maturin build --features jemalloc` on Linux/macOS
(no-op on Windows/MSVC, which keeps the system allocator). On the single-thread
interval-operation benchmark suite jemalloc was ~12% faster with equal-or-lower
peak memory than the default system allocator.

## [0.32.0] - 2026-06-30

### Added
Expand Down
21 changes: 21 additions & 0 deletions Cargo.lock

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

10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ name = "polars_bio"
version = "0.32.0"
edition = "2021"

[features]
# Opt-in jemalloc global allocator (issue #402). Off by default.
# Enable with `--features jemalloc` on Linux/macOS; it is a no-op on Windows/MSVC
# (tikv-jemallocator does not support the MSVC target), which keeps the system
# allocator there. Benchmarks: ~12% faster and lower peak RSS vs the default
# allocator on the single-thread interval-operation suite.
jemalloc = ["dep:tikv-jemallocator"]

[lib]
name = "polars_bio"
crate-type= ["cdylib"]
Expand All @@ -14,6 +22,8 @@ crate-type= ["cdylib"]
datafusion-python = { version = "53.0.0", default-features = false }
pyo3 = { version = "0.28.3", features = ["extension-module", "abi3"] }
pyo3-log = "0.13.3"
# Optional jemalloc allocator, gated behind the `jemalloc` feature (see [features]).
tikv-jemallocator = { version = "0.6", optional = true }


# NOTE: temporarily pinned to 53.0.0 (down from 53.1.0) to match datafusion-bio-formats
Expand Down
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ mod scan;
mod utils;
mod write;

// Opt-in jemalloc global allocator (issue #402), enabled with `--features jemalloc`.
// Excluded on Windows/MSVC, where tikv-jemallocator is unsupported; that target keeps
// the system allocator.
#[cfg(all(feature = "jemalloc", not(target_env = "msvc")))]
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

use std::string::ToString;
use std::sync::Arc;

Expand Down
Loading