Code size analysis#
pw_bytes: Utilities for manipulating binary data
This page analyzes the code size impact of using components from the
pw_bytes
module.
Size report: using ByteBuffer vs. manual manipulation#
The following report compares the code size of using
pw::ByteBuffer
for constructing and parsing a simple byte sequence
versus manually performing similar operations with std::memcpy
and bitwise
logic for endianness.
pw::ByteBuffer
can offer improved type safety and convenience,
potentially at a small code size cost for very simple operations, but can lead
to more maintainable and less error-prone code for complex byte manipulations.
Label |
Segment |
Delta |
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Using ByteBuilder vs. not using it |
FLASH
|
+144 |
|||||||||||||||||||||
RAM
|
+8 |