Sonar helps you commit clean code every time. With over 225 unique rules to find Python bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work. Learn more →
Msgspec Alternatives
Similar projects and alternatives to msgspec
-
orjson
Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy
-
-
InfluxDB
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
-
-
starlite
Light, Flexible and Extensible ASGI API framework | Effortlessly Build Performant APIs
-
ultrajson
Ultra fast JSON decoder and encoder written in C with Python bindings
-
-
MessagePack
MessagePack serializer implementation for Java / msgpack.org[Java]
-
Sonar
Write Clean Python Code. Always.. Sonar helps you commit clean code every time. With over 225 unique rules to find Python bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work.
-
-
-
-
marshmallow
A lightweight library for converting complex objects to and from simple Python datatypes.
-
fastapi
FastAPI framework, high performance, easy to learn, fast to code, ready for production
-
FrameworkBenchmarks
Source for the TechEmpower Framework Benchmarks project
-
-
ujrpc
Up to 100x Faster FastAPI. JSON-RPC with io_uring, SIMDJSON, and pure CPython bindings
-
-
-
ukv
Replacing MongoDB, Neo4J, and Elastic with 1 transactional database. Features: zero-copy semantics, swappable backends, bindings for C, C++, Python, Java, GoLang
-
typedload
Python library to load dynamically typed data into statically typed data structures
-
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
msgspec reviews and mentions
-
Starlite updates March '22 | 2.0 is coming
This feature is yet to be released, but it will allow you to seamlessly use data modelled with for example Pydantic, SQLAlchemy, msgspec or dataclasses in your route handlers, without the need for an intermediary model; The conversion will be handled by the specific DTO "backend" implementation. This new paradigm also makes it trivial to add support for any such modelling library, by simply implementing an appropriate backend.
-
Show HN: Up to 100x Faster FastAPI with simdjson and io_uring on Linux 5.19
If you're primarily targeting Python as an application layer, you may also want to check out my msgspec library[1]. All the perf benefits of e.g. yyjson, but with schema validation like pydantic. It regularly benchmarks[2] as the fastest JSON library for Python. Much of the overhead of decoding JSON -> Python comes from the python layer, and msgspec employs every trick I know to minimize that overhead.
-
Pydantic vs Protobuf vs Namedtuples vs Dataclasses
There's also msgspec, which per my benchmarks is: - 20-80x faster for JSON encode/decode + validate than pydantic - 5-50x faster to create/compare/order than attrs/dataclasses or pydantic.
-
Data Classification: Does Python still have a need for class without dataclass?
Integrating `dataclass` more into the language builtins might be nice, if only that it may allow/encourage a more native and performant implementation. Using a dataclass right now results in slightly slower class operations than handwritten types, and much slower import times.
I maintain another dataclass-like library[1] that's written fully as a C extension. Moving this code to C means these types are typically 5-10x faster for common operations[2]. It'd be nice if the builtin dataclasses were equally performant.
[1]: https://github.com/jcrist/msgspec
[2]: https://jcristharif.com/msgspec/benchmarks.html#benchmark-st...
-
Koda Validate: Alternative to Pydantic that is faster, more flexible, and async-compatible.
I maintain another "fast" validation-adjacent project (https://jcristharif.com/msgspec/) that handles only the serialization + validation component, not worrying about validation of internal function calls. I could see these projects pairing really nicely together, will definitely keep koda-validate in mind for future work.
-
Starlite development updates January ’23
In version 1.45.0, we introduced msgspec as our serialization backend, replacing orjson. This had some immediate performance benefits, but that's not the main reason we made the switch.
-
Starlite December '22 Updates
Not sure what the downvotes are for, because holy crap you weren't kidding!
We use msgspec for serialization. This is way faster than the stdlib's json module. The most significant difference you're seeing is dataclasses. The reason there is that msgspec natively supports dataclasses, while the json module does not.
-
Falcon vs Flask?
Regarding serialisation, take a look at msgspec. It doesn’t support all the features of marshmallow out of the box, but if you can make its Structs work for you, it can be orders of magnitude faster.
-
Processing JSON 2.5x faster than simdjson with msgspec
Msgspec achieves this performance by doing less work - it's only parsing the fields that are used for the query. Allocating objects in Python can be slow, by specifying the required fields for the query (though a type annotated schema), we reduce allocations to the bare minimum resulting in measurable speedups. There's a longer writeup in the example docs if you're interested.
-
A note from our sponsor - Sonar
www.sonarsource.com | 29 Mar 2023
Stats
jcrist/msgspec is an open source project licensed under BSD 3-clause "New" or "Revised" License which is an OSI approved license.