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.1μs
attrs + cattrs 19.3.0 1.4x slower 59.1μs
valideer 0.4.2 1.4x slower 60.9μs
marshmallow 2.15.1 3.0x slower 130.2μs
toasted-marshmallow 2.15.2post1 3.2x slower 138.3μs
trafaret 2.0.0 3.5x slower 149.8μs
django-restful-framework 3.10.3 13.0x slower 560.9μ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.