Benchmarks

Below are the results of crude benchmarks comparing pydantic to other validation libraries.

Package Version Relative Performance Mean validation time
pydantic 1.7.3 93.7μs
attrs + cattrs 20.3.0 1.5x slower 143.6μs
valideer 0.4.2 1.9x slower 175.9μs
marshmallow 3.10.0 2.4x slower 227.6μs
voluptuous 0.12.1 2.7x slower 257.5μs
trafaret 2.1.0 3.2x slower 296.7μs
schematics 2.1.0 10.2x slower 955.5μs
django-rest-framework 3.12.2 12.3x slower 1148.4μs
cerberus 1.3.2 25.9x slower 2427.6μ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.8.6 and the package versions listed above installed via pypi on macOS Bug Sur.