Skip to content

Implement AlignedStream and some other commonly used ones in Rust #84

Description

@Schamper

I don't think PyO3 allows easy subclassing of arbitrary Python classes (yet), so we probably need to use the same trick as CPython does in .io.py:

https://github.com/python/cpython/blob/b3308973e382d1a3c1627903779fcb89a40d7645/Lib/io.py#L68-L70

Should hopefully gain us some read performance.

Since we'll mostly just be handling Python objects but in some Rust code, and not doing as much native Rust interactions on the data, we should probably implement this mostly as Python-native types, for the reasons described here: https://pyo3.rs/v0.25.1/conversions/tables.html#using-rust-library-types-vs-python-native-types

Obviously should reference test some performance before doubling down on the implementation. A small POC with just AlignedStream implemented should be enough for that.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions