msgpackc: MessagePack in C with umsgpack's API, 20-120x faster on ESP32 #19787
Tangerino
started this conversation in
Show and tell
Replies: 1 comment
|
It's perhaps worth pointing out the purpose and some of the benefits of MessagePack. It's an encoding/decoding system like JSON. It's as easy to use as JSON but provides data compression. Whether you're writing to a file or sending data to a remote receiver there is a substantial reduction in data volume. A wide range of Python data types are natively supported, but it's easy to add further types to the protocol. It's widely supported so can be used for communication with a variety of non-MP platforms. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I've published msgpackc, a MessagePack serializer written in C as a user module for MicroPython v1.29: https://github.com/Tangerino/micropython-msgpackc
It is a drop-in replacement for Peter Hinch's excellent umsgpack. It has the same functions, options, exceptions and
@ext_serializableextension types, and produces byte-identical output. Existing code only needsimport msgpackc as umsgpack.Packing and unpacking a list of 20 telemetry records:
It also allocates much less: 1 KiB instead of 60 KiB per
dumpsin that test.Also included:
Unpackerfor incremental decoding (UART, sockets).ALoaderfor asyncio.Tests:
Ready-made firmware for ESP32 (with and without PSRAM), S3, C3, C6 and P4 is attached to the release, so you can try it without building anything: https://github.com/Tangerino/micropython-msgpackc/releases/latest
Feedback, bug reports and results on other boards are very welcome.
msgpackc was developed with an AI coding agent (Claude Code) working at my request.
All reactions