Skip to content

Commit 644e9a4

Browse files
committed
Update README
1 parent fe56e0d commit 644e9a4

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ It is:
77

88
:runner: Fast! Uses an internal typesystem for maximum performance.
99

10-
:brain: Smart! Supports `typing`, constraints, auto-casting, and much more.
10+
:brain: Smart! Supports `typing`, forward-references, constraints, auto-casting, and more.
1111

1212
:gear: Configurative! Write your own type system, and use it with *dataclass* and *dispatch*.
1313

@@ -20,10 +20,11 @@ It is:
2020
- :star: [**dataclass**](https://runtype.readthedocs.io/en/latest/dataclass.html) - Adds run-time type validation to the built-in dataclass.
2121

2222
- Improves dataclass ergonomics.
23+
- Supports most mypy constructs, like `typing` and forward-references (`foo: 'Bar'`).
2324
- Supports automatic value casting, Pydantic-style. (Optional, off by default)
2425
- Supports types with constraints. (e.g. `String(max_length=10)`)
2526
- Supports optional sampling for faster validation of big lists and dicts.
26-
- 40% faster than Pydantic ([read here](https://runtype.readthedocs.io/en/latest/dataclass.html#compared-to-pydantic))
27+
- Twice faster than Pydantic ([read here](https://runtype.readthedocs.io/en/latest/dataclass.html#compared-to-pydantic))
2728

2829
- :star: [**dispatch**](https://runtype.readthedocs.io/en/latest/dispatch.html) - Provides fast multiple-dispatch for functions and methods, via a decorator.
2930

docs/dataclass.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,11 @@ Example:
112112
Compared to Pydantic
113113
~~~~~~~~~~~~~~~~~~~~
114114

115-
Using Pydantic's own benchmark, runtype performs 40% faster than Pydantic. (or, Pydantic 30% slower than Runtype)
115+
Using Pydantic's own benchmark, runtype performs twice faster than Pydantic. (or, Pydantic is twice slower than Runtype)
116116

117117
::
118-
119-
pydantic best=70.296μs/iter avg=79.918μs/iter stdev=11.326μs/iter version=1.8.1
120-
attrs + cattrs best=75.502μs/iter avg=85.398μs/iter stdev=6.485μs/iter version=21.2.0
121-
runtype best=49.468μs/iter avg=57.926μs/iter stdev=11.853μs/iter version=0.2.1
122-
118+
pydantic best=63.839μs/iter avg=65.501μs/iter stdev=1.763μs/iter version=1.9.1
119+
attrs + cattrs best=45.607μs/iter avg=45.804μs/iter stdev=0.386μs/iter version=21.4.0
120+
runtype best=31.500μs/iter avg=32.281μs/iter stdev=0.753μs/iter version=0.2.7
123121

124122
See the code `here <https://github.com/samuelcolvin/pydantic/pull/3264>`_.

0 commit comments

Comments
 (0)