Avatar for the pydantic user
pydantic
pydantic-core
BlogDocsChangelog

dataclass serialization speedups

#1162Merged
Comparing
dataclass-ser-speedups
(
6740e73
) with
main
(
e1cb0eb
)
CodSpeed Performance Gauge
-13%
Regression
1
Untouched
142
New
3

Benchmarks

146 total
test_core_future_str
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateTime
CodSpeed Performance Gauge
-13%
21.5 µs24.7 µs
test_dataclass_serialization_python
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
N/A
N/A26.3 µs
test_dataclass_to_json
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
N/A
N/A41 µs
test_dataclass_serialization_json
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
N/A
N/A27.7 µs
test_chain_nested_functions
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+4%
28.6 µs27.6 µs
test_complete_core_isinstance
tests/benchmarks/test_complete_benchmark.py
CodSpeed Performance Gauge
+4%
1.9 ms1.8 ms
test_to_string_direct
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+3%
21.9 µs21.2 µs
test_validate_literal[python-few_str_enum]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
18.2 µs17.7 µs
test_validate_literal[python-many_small_strings]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
14.7 µs14.3 µs
test_core_python
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateTime
CodSpeed Performance Gauge
+3%
31.5 µs30.7 µs
test_set_of_ints_core_length
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
799.8 µs782.3 µs
test_set_of_ints_core
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
787.9 µs770.8 µs
test_complete_core_error
tests/benchmarks/test_complete_benchmark.py
CodSpeed Performance Gauge
+2%
1.9 ms1.9 ms
test_set_of_ints_core_json_duplicates
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
714.8 µs701.6 µs
test_build_schema
tests/benchmarks/test_complete_benchmark.py
CodSpeed Performance Gauge
+2%
885.3 µs870.4 µs
test_validate_literal[python-many_large_strings]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
14.7 µs14.5 µs
test_set_of_ints_core_json
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
1.2 ms1.1 ms
test_dict_of_any_core
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
772.6 µs761.5 µs
test_validate_literal[python-few_mixed]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
19.1 µs18.8 µs
test_dict_of_ints_core
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
1.1 ms1.1 ms
test_isinstance_string_strict_true
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
13.9 µs13.7 µs
test_tuple_many_positional
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
21.1 µs20.9 µs
test_validate_literal[python-few_large_strings]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
14.7 µs14.5 µs
test_isinstance_string_strict_false
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
15.2 µs15 µs
test_dont_raise_error_no_info
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
18 µs17.8 µs

Commits

Click on a commit to change the comparison range
Base
main
e1cb0eb
+14.3%
to_json benchmark
2a73357
2 years ago
by samuelcolvin
-27.95%
rename iterator structs for consistency
0797e59
2 years ago
by samuelcolvin
+0.59%
implement suggestions
6740e73
2 years ago
by samuelcolvin
© 2026 CodSpeed Technology
Home Terms Privacy Docs