Benchmarks
Below are the results of crude benchmarks comparing pydantic to other validation libraries.
Package | Version | Relative Performance | Mean validation time |
---|---|---|---|
pydantic | 1.1 |
43.6μs | |
attrs + cattrs | 19.3.0 |
1.4x slower | 59.9μs |
valideer | 0.4.2 |
1.4x slower | 61.8μs |
marshmallow | 3.2.2 |
2.5x slower | 107.6μs |
trafaret | 2.0.0 |
3.4x slower | 148.7μs |
django-rest-framework | 3.10.3 |
12.6x slower | 551.2μs |
cerberus | 1.3.2 |
26.3x slower | 1146.3μs |
See the benchmarks code for more details on the test case. Feel free to suggest more packages to benchmark or improve an existing one.
Benchmarks were run with Python 3.7.4 and the package versions listed above installed via pypi on Ubuntu 18.04.