Skip to content

Support for python's Buffer protocol #52

@mkzeender

Description

@mkzeender

The save-stating and screenshotting methods should be able to read from and write to any python object that exposes a buffer.

Writing the data directly into a buffer will greatly increase performance, because you won't have to allocate memory for a bytes object, nor will you have to copy the data twice.

The buffer protocol was made an official protocol as of python 3.11, and all major array-like objects support it (including bytes, bytearray, array.array, numpy.array, etc).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions