samcrow / canadensis

A Rust implementation of Cyphal
Apache License 2.0
44 stars 5 forks source link

Reduce copying when serializing and deserializing #26

Open samcrow opened 1 year ago

samcrow commented 1 year ago

The current transmit code allocates a temporary buffer for each outgoing transfer and serializes the transfer there before splitting it into frames.

The current receive code does something similar: it collects the payloads of all frames into a buffer and then deserializes from the buffer.

It might be more efficient to serialize directly into frames, but that would make the code more complex.