Avatar for the pydantic user
pydantic
pydantic
BlogDocsChangelog

Only deepcopy non-updated fields in `model_copy()`

#13087Merged
Comparing
connorcarpenter15:fix/deepcopy-with-update
(
f08fb33
) with
main
(
177d21b
)
CodSpeed Performance Gauge
0%
Untouched
215
Ignored
2

Benchmarks

217 total
test_date_format_function
pydantic-core/tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+2%
54.8 µs53.6 µs
test_simple_recursive_model_schema_generation
tests/benchmarks/test_model_schema_generation_recursive.py
CodSpeed Performance Gauge
+2%
640 µs626.1 µs
test_enum_str_python
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
25.9 µs25.5 µs
test_list_of_models_validation[__init__]
tests/benchmarks/test_model_validation.py
CodSpeed Performance Gauge
+1%
73.7 µs72.7 µs
test_isinstance_json
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
20.9 µs20.6 µs
test_tagged_union_int_keys_python
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
21.8 µs21.6 µs
test_datetime_milliseconds
pydantic-core/tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
21.6 µs21.4 µs
test_core_python
pydantic-core/tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUUID
CodSpeed Performance Gauge
+1%
27.6 µs27.3 µs
test_model_eq_extra_forbid
tests/benchmarks/test_model_eq.py
CodSpeed Performance Gauge
+1%
38.3 µs38 µs
test_dont_raise_error_no_info
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
20.2 µs20 µs
test_validate_literal[json-few_large_strings]
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
18 µs17.8 µs
test_core_str
pydantic-core/tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUUID
CodSpeed Performance Gauge
+1%
21.6 µs21.4 µs
test_uuid_from_string_core
pydantic-core/tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUUID
CodSpeed Performance Gauge
+1%
21.6 µs21.4 µs
test_complex_model_validation[model_validate]
tests/benchmarks/test_model_validation.py
CodSpeed Performance Gauge
+1%
51 µs50.6 µs
test_enum_int_python
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
25.9 µs25.7 µs
test_tagged_union_int_keys_json
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
25.3 µs25.2 µs
test_chain_two_functions
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
30.5 µs30.3 µs
test_nested_model_validation[model_validate]
tests/benchmarks/test_model_validation.py
CodSpeed Performance Gauge
+1%
48.7 µs48.4 µs
test_model_core_json
pydantic-core/tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUUID
CodSpeed Performance Gauge
+1%
31.3 µs31.1 µs
test_chain_list
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
26.3 µs26.1 µs
test_core_model_json
pydantic-core/tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
27.2 µs27 µs
test_model_exclude_unset_true
pydantic-core/tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
38.2 µs38 µs
test_model_instance_abc
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
30.4 µs30.2 µs
test_datetime
pydantic-core/tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
24.3 µs24.2 µs
test_with_default
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
24.8 µs24.7 µs

Commits

Click on a commit to change the comparison range
Base
main
177d21b
-0.14%
Document `deep=True` + `update` interaction in `model_copy` docstring
702f09a
1 month ago
by connorcarpenter15
+0.06%
Merge branch 'main' into fix/deepcopy-with-update
18689df
29 days ago
by connorcarpenter15
-0.19%
Merge branch 'fix/deepcopy-with-update' of github.com:connorcarpenter15/pydantic into fix/deepcopy-with-update
be06ad0
24 days ago
by connorcarpenter15
+0.14%
Fixes
9290f98
20 days ago
by Viicos
-19.59%
update test
d007ded
20 days ago
by Viicos
+19.29%
Update tests
7f74757
20 days ago
by Viicos
+0.43%
lint
ab17af1
20 days ago
by Viicos
-26.03%
fix
bf24e45
20 days ago
by Viicos
+26.14%
Apply suggestions from code review
f08fb33
4 days ago
by Viicos
© 2026 CodSpeed Technology
Home Terms Privacy Docs