Our great sponsors
- InfluxDB - Collect and Analyze Billions of Data Points in Real Time
- Sonar - Write Clean Python Code. Always.
- Onboard AI - Learn any GitHub repo in 59 seconds
- Revelo Payroll - Free Global Payroll designed for tech teams
-
To test this, we will setup some benchmarks using pytest-benchmark, some sample data with a simple schema, and compare results between Python's dataclass, Pydantic v1, and v2.
-
I encourage you to checkout the official benchmarks for more realistic and detailed examples, and, as always, YMMV.
-
InfluxDB
Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.
-
For those unfamiliar, Pydantic is currently implemented in Python and this rewrite shifts most of the code to Rust, a systems programming language touted as "blazingly fast" and safe.
-
powertools-lambda-python
A developer toolkit to implement Serverless best practices and increase developer velocity.
It's worth noting that these improvements will also impact other libraries and frameworks that rely on Pydantic, such as FastAPI and AWS Lambda Powertools, which could deliver some transitive performance improvements to various projects that don't directly depend on Pydantic themselves.
-
If you work with backend APIs in Python, you've probably used or heard of Pydantic, perhaps from FastAPI. The library advertises itself as "data validation and settings management using Python type annotations" and it makes (de)serialization of data a breeze.1
-
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.
Related posts
- Making Python 100x faster with less than 100 lines of Rust
- Show HN: Mathesar – open-source collaborative UI for Postgres databases
- Active Malware Campaign Targeting Popular Python Packages Underway
- Could someone suggest a development environment and/or tools I could use? I'm looking for an environment similar to a browser. I plan on using Python to display the results of many calculations that would change, maybe every second or half second. With lots of variables involved. More details below.
- Python's “Disappointing” Superpowers