project-chip / rs-matter

Rust implementation of the Matter protocol. Status: Experimental
Apache License 2.0
310 stars 43 forks source link

Lower QR gen memory consumption #135

Closed ivmarkov closed 6 months ago

ivmarkov commented 6 months ago

The current QR gen uses internally two buffers which are really big: total size 10K+. And this is in addition to the need to supply an external buffer too.

After the changes, the QR gen does not allocate buffers on stack anymore, and works only with the single, externally-supplied buffer, which can be < 1000 bytes. Changes/improvements:

kedars commented 6 months ago

Looks good to me. QR Code on console is anyway a 'developer workflow', unless some products want to print it on an attached display. At some point, we should also move to calling this from the application instead of the rs-matter/src/core/.