Avatar for the pydantic user
pydantic
pydantic
BlogDocsChangelog

fix: skip deep-copying fields in model_copy when replaced by update

#13083Closed
Comparing
Bester1:fix-model-copy-deep-update
(
92c3c16
) with
main
(
b7e81cf
)
CodSpeed Performance Gauge
0%
Untouched
215
Ignored
2

Benchmarks

217 total
test_validators_build
tests/benchmarks/test_validators_build.py
CodSpeed Performance Gauge
+3%
1,014 µs983 µs
test_simple_recursive_model_schema_generation
tests/benchmarks/test_model_schema_generation_recursive.py
CodSpeed Performance Gauge
+2%
635.2 µs620.5 µs
test_tagged_union_with_str_discriminator_schema_generation
tests/benchmarks/test_model_schema_generation.py
CodSpeed Performance Gauge
+2%
1.1 ms1 ms
test_simple_model_validation[__init__]
tests/benchmarks/test_model_validation.py
CodSpeed Performance Gauge
+2%
40.2 µs39.6 µs
test_definition_model_core
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
1.1 ms1.1 ms
test_enum_str_python
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
26.2 µs26 µs
test_dataclass_serialization_json
pydantic-core/tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
26 µs25.8 µs
test_generic_recursive_model_schema_generation
tests/benchmarks/test_model_schema_generation_recursive.py
CodSpeed Performance Gauge
+1%
696.7 µs690 µs
test_list_of_strs_json_uncached
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
450.1 µs446.3 µs
test_validate_literal[json-few_ints]
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
17.7 µs17.5 µs
test_build_schema
pydantic-core/tests/benchmarks/test_complete_benchmark.py
CodSpeed Performance Gauge
+1%
230.3 µs228.4 µs
test_model_eq_extra_forbid
tests/benchmarks/test_model_eq.py
CodSpeed Performance Gauge
+1%
38.2 µs37.9 µs
test_validate_literal[python-few_ints]
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
16.3 µs16.2 µs
test_model_eq_extra_allow_no_extra
tests/benchmarks/test_model_eq.py
CodSpeed Performance Gauge
+1%
32.7 µs32.5 µs
test_validate_literal[json-few_mixed]
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
20.6 µs20.4 µs
test_list_of_ints_core_py
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
542.1 µs538.5 µs
test_validate_literal[json-many_ints]
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
17.7 µs17.6 µs
test_validate_literal[json-few_small_strings]
pydantic-core/tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
18 µs17.9 µs
test_failed_rebuild
tests/benchmarks/test_model_schema_generation.py
CodSpeed Performance Gauge
+1%
244.5 µs243 µs
test_core_python
pydantic-core/tests/benchmarks/test_micro_benchmarks.py::TestModelLarge
CodSpeed Performance Gauge
+1%
120 µs119.3 µs
test_nested_model_validation[__init__]
tests/benchmarks/test_model_validation.py
CodSpeed Performance Gauge
+1%
51.3 µs51 µs
test_core_python_fs
pydantic-core/tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkSimpleModel
CodSpeed Performance Gauge
+1%
70.6 µs70.2 µs
test_core_model_json_extra
pydantic-core/tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
30.8 µs30.6 µs
test_core_future
pydantic-core/tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateX
CodSpeed Performance Gauge
+1%
16 µs15.9 µs
test_efficiency_with_highly_nested_examples
tests/benchmarks/test_discriminated_unions.py
CodSpeed Performance Gauge
+1%
645.1 µs641.5 µs

Commits

Click on a commit to change the comparison range
Base
main
b7e81cf
-16.39%
fix: skip deep-copying fields in model_copy when they will be replaced by update
32bc7c4
26 days ago
+16.35%
style: ruff format pydantic/main.py
92c3c16
26 days ago
© 2026 CodSpeed Technology
Home Terms Privacy Docs