samcrow / canadensis

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

SubjectIdList memory use #24

Open samcrow opened 1 year ago

samcrow commented 1 year ago

The generated SubjectIdList Rust type uses about 1024 bytes of memory for the Mask variant.

The BasicNode periodically publishes a port list, which contains two subject ID lists and two service ID lists. In total, it uses up about 2176 bytes of memory (even if the node is only active on a few ports). That's a lot of memory for a microcontroller.

The BasicNode's memory usage should be lower when fewer ports are active. It could use custom serialization code and a more compact storage format instead of the generated SubjectIdList.