Avatar for the pydantic user
pydantic
pydantic-core
BlogDocsChangelog

Add `SchemaSerializer.__reduce__` method to enable `pickle` serialization

#1006Merged
Comparing
edoakes:cloudpickle-support
(
722bbdf
) with
main
(
8e66bd9
)
CodSpeed Performance Gauge
+26%
Improvement
1
Untouched
139

Benchmarks

140 total
test_decimal_from_string_core
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDecimal
CodSpeed Performance Gauge
+26%
41.6 µs33.1 µs
test_model_exclude_unset_false
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+9%
35.1 µs32.1 µs
test_core_model_py
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+8%
31.9 µs29.5 µs
test_core_model_py_extra
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+6%
35.6 µs33.4 µs
test_core_model_json
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+5%
29.8 µs28.3 µs
test_core_model_json_extra
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+5%
34.2 µs32.5 µs
test_generator_rust
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+5%
22 µs21 µs
test_decimal_from_string_pyd
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDecimal
CodSpeed Performance Gauge
+3%
42.7 µs41.6 µs
test_to_string_format
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+2%
27.7 µs27.1 µs
test_uuid
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+2%
40.4 µs39.6 µs
test_core_root_model
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
42.1 µs41.4 µs
test_core_python
tests/benchmarks/test_micro_benchmarks.py::TestModelLarge
CodSpeed Performance Gauge
+2%
143.1 µs140.6 µs
test_list_of_dict_models_core
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
115.5 µs113.6 µs
test_isinstance_json
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
23.9 µs23.5 µs
test_validate_literal[json-few_str_enum]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
24.2 µs23.9 µs
test_core_json_fs
tests/benchmarks/test_micro_benchmarks.py::TestModelLarge
CodSpeed Performance Gauge
+1%
221.8 µs219 µs
test_tagged_union_int_keys_json
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
32.7 µs32.4 µs
test_date_format_function_no_info
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
52.5 µs51.9 µs
test_validate_literal[python-few_str_enum]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
20.1 µs19.9 µs
test_variable_tuple
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
23.1 µs22.9 µs
test_core_json
tests/benchmarks/test_serialization_micro.py::TestBenchmarkSimpleModel
CodSpeed Performance Gauge
+1%
96.8 µs96 µs
test_tagged_union_int_keys_python
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
33.8 µs33.6 µs
test_tuple_many_variable
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
23.7 µs23.6 µs
test_complete_core_strict
tests/benchmarks/test_complete_benchmark.py
CodSpeed Performance Gauge
+1%
284.2 µs282.2 µs
test_json_any_list_str
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
283.1 µs281.1 µs

Commits

Click on a commit to change the comparison range
Base
main
8e66bd9
+16.03%
Add __reduce__ method to SchemaSerializer
a1c6164
2 years ago
by edoakes
-36.49%
Revert changes to _pydantic_core.pyi
ce155b8
2 years ago
by edoakes
+1.87%
Fix constructor in tests
3159084
2 years ago
by edoakes
-1.94%
Handle Option in __traverse__
cdc32a2
2 years ago
by edoakes
+1.22%
Make the linter happy
bba95d8
2 years ago
by edoakes
-0.86%
Add test_pickling.py
24ad5b0
2 years ago
by edoakes
+4.11%
Fix imports
bdafefd
2 years ago
by edoakes
+0.39%
Fix imports
8c41c88
2 years ago
by edoakes
-3.3%
Fix lint
70f3032
2 years ago
by edoakes
+20.19%
Add config to gc.collect() test
8b8bfd5
2 years ago
by edoakes
-21.14%
Fix lint
661ac07
2 years ago
by edoakes
+36.09%
Update validator __reduce__ to include config
9ef470b
2 years ago
by edoakes
-32.11%
Fix config test
26cb67a
2 years ago
by edoakes
+0.76%
Fix tests
ed3ad18
2 years ago
by edoakes
+15.36%
Revert small type change
e11ba19
2 years ago
by edoakes
+0.38%
Merge branch 'main' of https://github.com/pydantic/pydantic-core into cloudpickle-support
6cbba7b
2 years ago
by edoakes
-19.19%
Add config to gc test
1d17408
2 years ago
by edoakes
+44.42%
small nit
722bbdf
2 years ago
by edoakes
© 2026 CodSpeed Technology
Home Terms Privacy Docs