Avatar for the pydantic user
pydantic
pydantic-core
BlogDocsChangelog

Improvements in union matching logic during validation

#1332Merged
Comparing
union-val-fix
(
ed8ddb9
) with
main
(
46379ac
)
CodSpeed Performance Gauge
+1%
Untouched
155

Benchmarks

155 total
test_datetime
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+5%
27.7 µs26.5 µs
test_validate_literal[python-many_small_strings]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+4%
15 µs14.5 µs
test_model_core_json
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUUID
CodSpeed Performance Gauge
+3%
48 µs46.5 µs
test_to_json_list_of_lists
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+3%
1.7 ms1.6 ms
test_strict_int
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
13.8 µs13.4 µs
test_bytes_core
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
13.7 µs13.4 µs
test_validate_literal[python-few_mixed]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
17.1 µs16.6 µs
test_int_range
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
15 µs14.6 µs
test_validate_literal[json-many_large_strings]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
16.2 µs15.8 µs
test_validate_literal[json-few_mixed]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
18.6 µs18.1 µs
test_validate_literal[python-few_str_enum]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
15.5 µs15.1 µs
test_chain_list
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
25.7 µs25.1 µs
test_arguments
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
26.8 µs26.1 µs
test_positional_tuple
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
19.5 µs19.1 µs
test_validate_literal[python-few_ints]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
14.7 µs14.4 µs
test_validate_literal[python-few_small_strings]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
14.9 µs14.5 µs
test_core_string_strict
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
13.8 µs13.5 µs
test_generator_rust
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
19.8 µs19.3 µs
test_int_range_json
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
15.7 µs15.3 µs
test_enum_int_core
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
15.6 µs15.3 µs
test_validate_literal[json-few_large_strings]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
16.2 µs15.8 µs
test_validate_literal[python-few_large_strings]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
15 µs14.7 µs
test_core_string_lax
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
13.8 µs13.5 µs
test_small_class_core_dict
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
19.4 µs19 µs
test_validate_literal[json-many_ints]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
15.5 µs15.2 µs

Commits

Click on a commit to change the comparison range
Base
main
46379ac
-0.1%
first pass at union match improvement
9117c6b
2 years ago
by sydney-runkle
+0.69%
behavior for checking model fields set
ceb5e1b
2 years ago
by sydney-runkle
-0.69%
working on my rust best practices
1a6b00c
2 years ago
by sydney-runkle
-47.02%
using method on Validator trait to streamline things
1718e8b
2 years ago
by sydney-runkle
-0.38%
comment udpate
500a812
2 years ago
by sydney-runkle
+1.05%
get all tests passing
d479928
2 years ago
by sydney-runkle
-0.31%
use Union not pipe in tests
e16103a
2 years ago
by sydney-runkle
+47.48%
abandon num_fields for a state based approach
9208282
2 years ago
by sydney-runkle
-13.07%
get typed dicts working, add tests for other model like cases
69f6ec0
2 years ago
by sydney-runkle
+13.12%
dataclass support + more efficient exact return
18b70d4
2 years ago
by sydney-runkle
-0.75%
all dataclass tests passing :)
e4f1e6b
2 years ago
by sydney-runkle
+0.95%
add nested counting for dataclasses, typed dicts
fc21636
2 years ago
by sydney-runkle
-0.31%
corresponding tests
72aa7bd
2 years ago
by sydney-runkle
+0.21%
updating fields set at the end)
d2ef400
2 years ago
by sydney-runkle
-0.2%
abbreviated syntax
38f911f
2 years ago
by sydney-runkle
+0.2%
adding a bubble up test + doing some minor test refactoring
c3b43e9
2 years ago
by sydney-runkle
-0.03%
3.8 fixes
31a439a
2 years ago
by sydney-runkle
+0.07%
oops, another list
ed920ad
2 years ago
by sydney-runkle
-0.07%
ugh, last 3.8 fix hopefully
645f917
2 years ago
by sydney-runkle
-0.05%
name change success -> best_match
ed8ddb9
2 years ago
by sydney-runkle
© 2026 CodSpeed Technology
Home Terms Privacy Docs