Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add benchmark for valideer #670

Merged
merged 6 commits into from Nov 8, 2019
Merged

Add benchmark for valideer #670

merged 6 commits into from Nov 8, 2019

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 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
Owner

@samuelcolvin samuelcolvin commented Aug 6, 2019

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 gsakkis commented Aug 6, 2019

Sure no rush, thanks for the update.

@samuelcolvin samuelcolvin added the deferred label Aug 17, 2019
@samuelcolvin samuelcolvin removed the deferred label Nov 8, 2019
@samuelcolvin
Copy link
Owner

@samuelcolvin samuelcolvin commented Nov 8, 2019

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 samuelcolvin:master Nov 8, 2019
11 checks passed
@gsakkis
Copy link
Contributor Author

@gsakkis gsakkis commented Nov 9, 2019

Great, thank you!

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

* valideer version and update benchmarks

* add change

* correct benchmarks
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.

None yet

2 participants