microzig icon indicating copy to clipboard operation
microzig copied to clipboard

Feature request: Deferred formating

Open PhilippWendel opened this issue 1 year ago • 0 comments

Deferred formating would be a nice feature to have in microzig.

Deferred formating could help to

  • reduce binary size
  • speed up serial transmission
  • reduce cpu time

Operating principle

defmt achieves high performance using deferred formatting and string compression.

Deferred formatting means that formatting is not done on the machine that's logging data but on a second machine. That is, instead of formatting 255u8 into "255" and sending the string, the single-byte binary data is sent to a second machine, the host, and the formatting happens there.

defmt's string compression consists of building a table of string literals, like "Hello, world" or "The answer is {:?}", at compile time. At runtime the logging machine sends indices instead of complete strings.

-- https://defmt.ferrous-systems.com/#operating-principle

PhilippWendel avatar Nov 27 '24 16:11 PhilippWendel