Avatar for the pydantic user
pydantic
pydantic-core
BlogDocsChangelog

Adding tagged union serializer 🚀

#1397Merged
Comparing
union-ser-fixes
(
f1236ff
) with
main
(
3d8295e
)
CodSpeed Performance Gauge
0%
Untouched
155

Benchmarks

155 total
test_decimal_from_string_limit
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDecimal
CodSpeed Performance Gauge
+5%
19.1 µs18.2 µs
test_small_class_core_model
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
30.8 µs29.8 µs
test_generator_python
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
27.3 µs26.8 µs
test_decimal_from_string_pyd
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDecimal
CodSpeed Performance Gauge
+2%
33.1 µs32.5 µs
test_field_function_validator
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
382.4 µs376.9 µs
test_enum_str_core
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
15.1 µs14.9 µs
test_smart_union_core
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUnion
CodSpeed Performance Gauge
+1%
15.9 µs15.7 µs
test_core_json_fs
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkSimpleModel
CodSpeed Performance Gauge
+1%
123.7 µs122.2 µs
test_enum_int_python
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
24.3 µs24.1 µs
test_arguments
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
25.9 µs25.6 µs
test_core_string_lax
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
13.7 µs13.5 µs
test_validate_literal[python-few_mixed]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
16.9 µs16.7 µs
test_dataclass_serialization_python
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
23.2 µs22.9 µs
test_smart_union_coerce_core
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUnion
CodSpeed Performance Gauge
+1%
17.5 µs17.3 µs
test_validate_literal[python-few_large_strings]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
14.9 µs14.7 µs
test_list_of_strs_json_cached
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
318 µs315.3 µs
test_validate_literal[python-many_small_strings]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
14.7 µs14.6 µs
test_enum_str_python
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
24 µs23.8 µs
test_dataclass_serialization_json
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
24.9 µs24.7 µs
test_validate_literal[json-few_str_enum]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
19.9 µs19.8 µs
test_date_format_function
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
51.9 µs51.6 µs
test_list_of_ints_core_json
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
766.5 µs762 µs
test_validate_literal[python-few_small_strings]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
14.7 µs14.7 µs
test_tagged_union_int_keys_json
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
26.2 µs26 µs
test_nested_schema_inlined
tests/benchmarks/test_nested_benchmark.py
CodSpeed Performance Gauge
+1%
20.8 ms20.7 ms

Commits

Click on a commit to change the comparison range
Base
main
3d8295e
-0.3%
removing self schema according to https://github.com/pydantic/pydantic-core/commit/5efeaf9fe6cb5e57c77e42644387afa781b127e0
80839e0
2 years ago
by sydney-runkle
+0.17%
finish logic up
c69263d
2 years ago
by sydney-runkle
-0.34%
use to string conversion
4d7cb37
2 years ago
by sydney-runkle
+0.21%
another simplification
7b189aa
2 years ago
by sydney-runkle
+0.21%
adding tagged union test
37b4dbb
2 years ago
by sydney-runkle
+0.32%
fixing merge conflict
e3aceeb
2 years ago
by sydney-runkle
+0.05%
moving union const
a04e297
2 years ago
by sydney-runkle
-0.06%
final cleanup, thanks @davidhewitt
c325609
2 years ago
by sydney-runkle
-0.24%
limit value_str
f1236ff
2 years ago
by sydney-runkle
© 2026 CodSpeed Technology
Home Terms Privacy Docs