Skip to content

Faster Python Serialization #4668

Description

@tokotchd

Hello,

I see that there is great support for reading numpy arrays from flatbuffer vectors. I'm ecstatic that this is supported, but I could not find the reverse functionality.

In fact, It seems that the only way to write data to flatbuffer vectors in python is with builder.prependByte(). As you image, this is unusably slow for large data.

It seems like there could be a fairly easy and fast method of implementation that involves something akin to: builder.CreateByteVector(<numpy.ndarray>.tobytes()). Unfortunately, without hacking apart the library, there's assertions in place to prevent using this function from Python within the scope of another table or struct (nested assert), which is where it would need to be as I understand it.

@kbrose created the original functionality, is there a chance he'd be willing to work on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions