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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link
Contributor Author

gsakkis commented Aug 6, 2019

Sure no rush, thanks for the update.

samuelcolvin added 2 commits Nov 8, 2019
@samuelcolvin samuelcolvin removed the deferred label Nov 8, 2019
@samuelcolvin

This comment has been minimized.

Copy link
Owner

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 added 3 commits Nov 8, 2019
@samuelcolvin samuelcolvin merged commit 69737c3 into samuelcolvin:master Nov 8, 2019
11 checks passed
11 checks passed
Header rules No header rules processed
Details
Pages changed 7 new files uploaded
Details
Redirect rules No redirect rules processed
Details
Mixed content No mixed content detected
Details
codecov/project 100% remains the same compared to b87ca4e
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
samuelcolvin.pydantic Build #20191108.33 succeeded
Details
samuelcolvin.pydantic (Job Python36) Job Python36 succeeded
Details
samuelcolvin.pydantic (Job Python37) Job Python37 succeeded
Details
samuelcolvin.pydantic (Job Python38) Job Python38 succeeded
Details
@gsakkis

This comment has been minimized.

Copy link
Contributor Author

gsakkis commented Nov 9, 2019

Great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.