Skip to content

feat: Add arro3 Cargo feature to pyo3-arrow#478

Open
hombit wants to merge 1 commit intokylebarron:mainfrom
light-curve:pyo3-arrow_arro3-feature
Open

feat: Add arro3 Cargo feature to pyo3-arrow#478
hombit wants to merge 1 commit intokylebarron:mainfrom
light-curve:pyo3-arrow_arro3-feature

Conversation

@hombit
Copy link

@hombit hombit commented Feb 18, 2026

I gated all Python interface (arro3-core) specifics under the arro3 Cargo feature. Basically, I hid all #[pymethods] and then refactored the Rust interface code that was using Python methods.

When I started this PR, I was hoping to reduce compilation time and extension library size for the users of pyo3-arrow, but it actually didn’t work well. Most of the gated crates are still transitive dependencies through arrow-* crates, which do not gate them over Cargo features. However, turning off arro3 feature would remove seven dependencies. I benchmarked the changes with a test maturin project, which just implements a single method from the pyo3-arrow docs, and maturin build --release times reduced by 5–10%, while the wheel size changed by only 150 kB. I tried with default linking settings and with lto = true; codegen-units = 1, but the differences with and without the new arro3 feature don’t depend on these settings.

I’ll let you decide if these changes are useful.

Fixes #477, fixes #395

@hombit hombit force-pushed the pyo3-arrow_arro3-feature branch from 2c80a4a to b82f694 Compare February 18, 2026 16:01
@hombit hombit force-pushed the pyo3-arrow_arro3-feature branch from b82f694 to 2e76594 Compare February 18, 2026 16:04
@hombit hombit changed the title Add arro3 Cargo feature to pyo3-arrow feat: Add arro3 Cargo feature to pyo3-arrow Feb 18, 2026
@github-actions github-actions bot added the feat label Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce dependency footprint of pyo3-arrow pyo3-arrow: Compile-time flag for whether to attach pymethods to objects

1 participant

Comments