update benchmarks (#563)

* update benchmarks

* optimize
This commit is contained in:
Samuel Colvin
2019-05-30 12:43:44 +01:00
committed by GitHub
parent d473f4abc9
commit b248a0984f
3 changed files with 20 additions and 7 deletions
+5 -5
View File
@@ -1,5 +1,5 @@
pydantic,,24.8μs,0.257μs
toasted-marshmallow,1.6x slower,39.5μs,0.134μs
marshmallow,1.9x slower,47.4μs,0.181μs
trafaret,2.3x slower,56.1μs,0.253μs
django-restful-framework,16.0x slower,397.5μs,0.382μs
pydantic,,12.0μs,0.263μs
toasted-marshmallow,1.9x slower,22.7μs,0.186μs
marshmallow,2.1x slower,25.2μs,0.173μs
trafaret,2.2x slower,26.6μs,0.259μs
django-restful-framework,20.0x slower,240.7μs,1.410μs
1 pydantic 24.8μs 12.0μs 0.257μs 0.263μs
2 toasted-marshmallow 1.6x slower 1.9x slower 39.5μs 22.7μs 0.134μs 0.186μs
3 marshmallow 1.9x slower 2.1x slower 47.4μs 25.2μs 0.181μs 0.173μs
4 trafaret 2.3x slower 2.2x slower 56.1μs 26.6μs 0.253μs 0.259μs
5 django-restful-framework 16.0x slower 20.0x slower 397.5μs 240.7μs 0.382μs 1.410μs
+14 -2
View File
@@ -886,8 +886,20 @@ Below are the results of crude benchmarks comparing *pydantic* to other validati
:align: center
:file: benchmarks.csv
(See `the benchmarks code <https://github.com/samuelcolvin/pydantic/tree/master/benchmarks>`_
for more details on the test case. Feel free to submit more benchmarks or improve an existing one.)
See `the benchmarks code <https://github.com/samuelcolvin/pydantic/tree/master/benchmarks>`_
for more details on the test case. Feel free to submit more benchmarks or improve an existing one.
Benchmarks were run with python 3.7.2 and the following package versions:
* **pydantic** pre ``v0.27``
`d473f4a <https://github.com/samuelcolvin/pydantic/commit/d473f4abc9d040c8c90e102017aacfc078f0f37d>`_ compiled with
cython
* **toasted-marshmallow** ``v0.2.6``
* **marshmallow** the version installed by ``toasted-marshmallow``, see
`this <https://github.com/lyft/toasted-marshmallow/issues/9>`_ issue.
* **trafaret** ``v1.2.0``
* **django-restful-framework** ``v3.9.4``
Contributing to Pydantic
------------------------
+1
View File
@@ -54,6 +54,7 @@ if 'clean' not in sys.argv and 'SKIP_CYTHON' not in os.environ:
compiler_directives = {}
if 'CYTHON_TRACE' in sys.argv:
compiler_directives['linetrace'] = True
os.environ['CFLAGS'] = '-O3'
ext_modules = cythonize(
'pydantic/*.py',
nthreads=4,