Skip to content

Conversation

gsakkis
Copy link
Contributor

@gsakkis gsakkis commented Jul 17, 2019

Added a new benchmark for Valideer, yet another validation library (Disclaimer: I am the main author).

Despite the fact that high performance was not among valideer's goals and that it is a pure python package written ~7 years ago, it appears to be as fast as pydantic when the latter is compiled with Cython and 1.6x faster when not. Here are some benchmark results on python 3.6.7:

pydantic (cython)        best=15.165μs/iter  avg=15.842μs/iter  stdev=0.685μs/iter
valideer                 best=15.686μs/iter  avg=15.885μs/iter  stdev=0.219μs/iter
pydantic (pure python)   best=24.488μs/iter  avg=25.639μs/iter  stdev=0.815μs/iter
toasted-marshmallow      best=34.630μs/iter  avg=35.930μs/iter  stdev=1.627μs/iter
marshmallow              best=35.155μs/iter  avg=36.345μs/iter  stdev=1.453μs/iter
trafaret                 best=37.089μs/iter  avg=37.947μs/iter  stdev=1.109μs/iter
django-restful-framework best=157.965μs/iter avg=162.176μs/iter stdev=3.537μs/iter

Package versions:

  • pydantic==0.30.1
  • valideer==0.4.2
  • toastedmarshmallow==2.15.2.post1
  • marshmallow==2.19.5
  • trafaret==1.2.0
  • djangorestframework==3.10.0

@codecov
Copy link

codecov bot commented Jul 17, 2019

Codecov Report

Merging #670 into master will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff          @@
##           master   #670   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          19     19           
  Lines        3237   3237           
  Branches      642    642           
=====================================
  Hits         3237   3237

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b87ca4e...d7a3e48. Read the comment docs.

@samuelcolvin
Copy link
Member

Thanks so much for this, sorry I haven't dealt with it. I'm going to defer further changes to benchmarks until after v1 (see #576), but after that I promise to deal with this.

Sorry again for the delay.

@gsakkis
Copy link
Contributor Author

gsakkis commented Aug 6, 2019

Sure no rush, thanks for the update.

@samuelcolvin samuelcolvin added the deferred Deferred until future release or until something else gets done label Aug 17, 2019
@samuelcolvin samuelcolvin removed the deferred Deferred until future release or until something else gets done label Nov 8, 2019
@samuelcolvin
Copy link
Member

I've merged master, and updated benchmarks. I'll merge this once tests pass.

valideer is still the fasted other than pydantic :-)

@samuelcolvin samuelcolvin merged commit 69737c3 into pydantic:master Nov 8, 2019
@gsakkis
Copy link
Contributor Author

gsakkis commented Nov 9, 2019

Great, thank you!

andreshndz pushed a commit to cuenca-mx/pydantic that referenced this pull request Jan 17, 2020
* Add benchmark for valideer

* valideer version and update benchmarks

* add change

* correct benchmarks
alexdrydew pushed a commit to alexdrydew/pydantic that referenced this pull request Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants