-
Notifications
You must be signed in to change notification settings - Fork 7
Description
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.