developmentseed / developmentseed/zarrista

Improve performance of exporting variable-width strings to numpy StringDType

Open
#147 1 comment 0 reactions 0 assignees View on GitHub
performance
Dominant language
Python
Stars
45
Forks
2
Avg merge
2d 4h
Merged PRs (30d)
7

Description

The only way to create a string-typed numpy array from Python is from a list of Python string objects. This is very slow because you first need to copy your data into Python string objects.

(There are some low-level `unsafe` numpy C APIs, but I don't want to be mucking around manually in the numpy C API.)

We currently export variable-width string data _first_ to a list of `PyString` and _then_ to the numpy array constructor.

Hopefully the Rust-numpy crate will add safe APIs for passing a vector of `String` or `&str` to numpy from Rust.

Contributor guide

No contributing guide indexed for this repository

Research direction

No file or test is named; start by tracing the current variable-width string export and reviewing the safe Rust-numpy APIs available for constructing StringDType arrays. Done means exporting the data without first copying it into a list of Python string objects, while preserving the existing result.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python, rust
Domain
backend-api-design, data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.