Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
msgspec
A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML
-
conda
A system-level, binary package and environment manager running on all major operating systems and platforms.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
ujson
orjson
simdjson
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.
I wrote this up as a demo of some potential optimization work in conda, but the same principle could be applied to other projects.
Related posts
- pyserde: Serialization library on top of dataclasses, inspired by serde-rs
- Need help developing a high performance Redis ORM for Python
- Pyserde: Serialization library on top of dataclasses, inspired by serde-rs
- Blog post: Writing Python like it’s Rust
- Show HN: Msgspec, a fast serialization/validation library for Python