-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reducing I/O by using buffers and memoryviews #67
Comments
kaitai-io/kaitai_struct#277 are related. Mmaps are memory views. |
Not according to the documentation: "Create a memoryview that references object. object must support the buffer protocol. Built-in objects that support the buffer protocol include bytes and bytearray." https://docs.python.org/3/library/stdtypes.html#memoryview As far as I can tell |
@armijnhemel, my bad, you are right. To work with |
This is something that I haven't fully thought out yet, but which might be useful in certain cases, such as when
io
is shared between elements (so when no new substreams are created). There are mechanisms in Python to reduce I/O and prevent unnecessary copying of data by using buffers and memoryviews. An article explaining it can be found here:https://eli.thegreenplace.net/2011/11/28/less-copies-in-python-with-the-buffer-protocol-and-memoryviews
The text was updated successfully, but these errors were encountered: