Commit Graph

23 Commits

Author SHA1 Message Date
Alvaro Leonel f32832ad8e Adds benchmark tests for Schematics tool (#2381)
* Adds benchmark tests for Schematics tool

* Removes the "to_json" method from the schematics benchmark tests

* Fixs exception check in the Schematics benchmark

* tweaks and cleanup

Co-authored-by: Alvaro Mariano <alvaro.mariano@br.experian.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2021-02-25 19:51:47 +00:00
PrettyWood e2fcab52b9 fix: validate and parse nested models properly with default_factory (#1712)
* fix: validate nested models with `default_factory`

PR #1504 introduced a regression by bypassing `populate_validators()`,
which would skip the validation of children in nested models
with `default_factory`

closes #1710

* test: add example of nested models parsing with `default_factory`

closes #1717

* add testcase from #1722

* bodge for benchmarks

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2020-07-15 20:23:18 +01:00
Samuel Colvin 43f61d4b76 error on failed import in benchmarks (#1661) 2020-06-27 13:42:59 +01:00
Stephen Brown II 0ba7710f35 Add JSON Benchmark (#1344)
* Add JSON Benchmark

* Apply iterator suggestions from code review

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>

* Reorganize run to avoid parsing time in json test

* tweak json benchmarks

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2020-04-15 21:52:04 +01:00
Stephen Brown II 0164db9daa Fix typo breaking pydantic-only benchmarks when TestCAttrs not available (#1282)
* Fix typo breaking pydantic-only benchmarks when TestCAttrs not available

* Add Pydantic-only benchmarks to CI


Remove requirements for pydantic-only benchmarks and update python ver

* Benchmarks output tweaks

- Left pad by only 4 more than the longest benchmark
- Add run number/total to each run
- Summarize what is being tested at beginning
2020-03-18 13:05:47 +00:00
Stephen Brown II 938335c46f Add benchmark for voluptuous library (#1292)
Voluptuous, despite the name, is a Python data validation library.

- GitHub: https://github.com/alecthomas/voluptuous
- PyPi: https://pypi.org/project/voluptuous

Package | Version | Relative Performance | Mean validation time
--- | --- | --- | ---
valideer | `0.4.2` |  | 104.2μs
attrs + cattrs | `19.3.0` | 1.1x slower | 114.4μs
pydantic | `1.4a1` | 1.2x slower | 124.3μs
marshmallow | `3.5.0` | 1.8x slower | 190.1μs
voluptuous | `0.11.7` | 2.2x slower | 227.6μs
trafaret | `2.0.2` | 2.4x slower | 253.0μs
django-rest-framework | `3.11.0` | 8.5x slower | 881.8μs
cerberus | `1.3.2` | 19.1x slower | 1993.8μs
2020-03-06 13:31:43 +00:00
Samuel Colvin 9255012c08 add version_info to make creating issues easier (#1071)
* add version_info to make creating issues easier

* improve version_info()

* improve contributing docs
2019-12-04 15:14:53 +00:00
Samuel Colvin 677537d1f5 Improve benchmarks (#987)
* add benchmarks for cerberus

* remove toasted-marshmallow, upgrade marshmallow
2019-11-13 15:34:31 +00:00
Samuel Colvin 4218ff7f36 rename cattr > cattrs, update benchmarks 2019-11-08 17:41:12 +00:00
George Sakkis 69737c3aa3 Add benchmark for valideer (#670)
* Add benchmark for valideer

* valideer version and update benchmarks

* add change

* correct benchmarks
2019-11-08 17:34:39 +00:00
Sebastian Mika b87ca4ee05 benchmark for cattrs (#513)
* benchmark for attr

* update HISTORY.rst

* * added benchmark using cattr
* add env "ATTRS=1" to benchmark runner to only compare again the two
  and save results in separate csv
* added section to docs/index

* nits

* re-run benchmark with cython pydantic; merge results back to main benchmarks results table

* pin pydantic to top of benchmark report

* remove attrs, fix cattrs

* update benchmarks output

* add change
2019-11-08 17:04:41 +00:00
Samuel Colvin 33b7d52d31 moving docs to mkdocs (#856)
* moving docs to mkdocs

* transfering readme to md and more

* fixing build

* splitting usage.md

* improving schema.md and index.md

* fix make_history.rst

* models intro

* working on data conversation and required fields

* more fixes to models.md

* list all standard types supported

* list of pydantic types

* tweaks

* update links in code

* Apply suggestions from code review

incorporate @dmontagu's suggestions.

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>

* Apply suggestions from code review

more missed suggestions.

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>

* Apply suggestions from code review

more corrects.

* cleanup

* Field order warning

* fix and regenerate benchmarks

* format examples better, cleanup

* improve schema mapping table

* correct highlighting file types in schema.md

* add redirects in javascript

* add logo
2019-10-07 17:19:01 +01:00
Samuel Colvin 0e8cfba713 small performance improvements to validators and fields (#763)
* small performance improvements to validators and fields

* simplify ErrorWrapper and ValidationError

* more cleanup of errors, combine test_error_wrapper.py and test_error.py

* tweak datetime_parse.py

* fix for python 3.6

* add change

* fix bug with int or float passed to datetime.time
2019-08-18 16:48:39 +01:00
Samuel Colvin 85f8a6b60e fix benchmarks with 3.7 (#219) 2018-07-02 12:28:46 +01:00
Samuel Colvin 2966beeb40 rerun benchmarks, update history 2018-03-25 18:24:40 +01:00
Samuel Colvin 7c9c0d46aa fix toastedmarshmallow benchmarks and add marshmallow benchmarks (#91)
* fix toastedmarshmallow benchmarks and add marshmallow benchmarks

* format benchmarks better

* add runtime for netlify

* remove sphinxcontrib-spelling==4.0.1

* remove docs linting

* adding benchmarks section to docs
2017-10-23 19:53:35 +01:00
Mickaël Guérin 1d9a337f70 Add Toasted Marshmallow Benchmark (#85)
https://github.com/lyft/toasted-marshmallow

As said in the README of this project :
Toasted Marshmallow implements a JIT for marshmallow that speeds up
dumping objects 10-25X (depending on your schema). Toasted Marshmallow
allows you to have the great API that Marshmallow provides without
having to sacrifice performance!
2017-10-23 15:26:51 +01:00
Samuel Colvin ebca8df223 improving benchmarks 2017-07-08 17:31:13 +01:00
Samuel Colvin 71a3b45995 speedup benchmarks 2017-06-13 10:15:19 +01:00
Samuel Colvin 6923e5e677 models allowing immutability (#44)
* working on models allowing immutability, ref #38

* up complexity

* use noqa c901

* fixing fields with new processor

* allow_mutation config and tests

* uprev, history and docs

* fix typos
2017-06-13 09:52:47 +01:00
Mickaël Guérin 8364a6b2d6 Add DRF Benchmark (#47) 2017-06-12 18:57:46 +01:00
Samuel Colvin 11ea624e62 add int size validation 2017-05-08 17:25:44 +01:00
Samuel Colvin ef60baa65e adding performance benchmarks 2017-05-08 15:56:36 +01:00