Supporting alternative msgpack implementations
See original GitHub issueormsgpack is a faster alternative to python-msgpack and since speed is critical/required in Web/ASGI application I think it would be nice to have support for using ormsgpack!
My current idea is to provide ormsgpack as an extra/optional dependency to msgpack-asgi
(installed like pip install msgpack-asgi[ormsgpack]
?) and provide two more classes to the public API ORMessagePackMiddleware
and ORMessagePackResponse
if ormsgpack can be imported.
I will happily create a PR and start working on this feature if this is something can be added to the project! 😄
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
MessagePack: It's like JSON. but fast and small.
MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller. Small ......
Read more >MessagePack Alternatives and Similar Projects - LibHunt
Which is the best alternative to MessagePack? Based on common mentions it is: ✓FlatBuffers, ✓Protobuf, ✓Cereal, ✓Boost.Serialization, ✓ArduinoJson or ...
Read more >MessagePack: an alternative to JSON? - Facile.it Engineering
MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON.
Read more >MessagePack (XML/JSON alternative) - Spriter - BrashMonkey
While doing research on JSON, I stumbled upon the MessagePack format. It's a binary object serialization system with support for quite a few ......
Read more >msgpack-asgi - PyPI
msgpack -asgi supports customizing the default encoding/decoding implementation. This is useful for fine-tuning application performance via an alternative ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Very interesting! I like the latter implementation. Supporting
ormsgpack
directly into the library wouldn’t be needed then. There’s also a lot of MessagePack flavors out there like u-msgpack-python (A Pure Python implementation) so that would be definitely a win win for everyone.But I assume this would be a breaking change, Right?
@FaresAhmedb Thanks, that’s useful info.
Actually, I assume most users would be in a “I’m fine-tuning performance” mindset, which means writing some custom code would be acceptable — if not appropriate. So I wonder about another option: a public “backend” interface.
Like this:
We’d add a
MsgPacker
for our current behavior, and advanced users could do all sorts of customized things, e.g. what you suggested,ormsgpack
for serialization vsmsgpack
for deserialization:Usage:
Or maybe, without classes, using
packb=...
andunpackb=...
options (I think I prefer this style):Thoughts?