Avatar for the pydantic user
pydantic
pydantic
BlogDocsChangelog

Preserve `__dict__` identity during `validate_assignment`

#12225
Comparing
rmur0:fix.cached.property
(
a3b2f20
) with
main
(
418c02e
)
CodSpeed Performance Gauge
-10%
Regressions
1
Untouched
45
Ignored
2

Benchmarks

Failed

test_setattrRegression
tests/benchmarks/test_attribute_access.py::test_setattr
CodSpeed Performance Gauge
-10%
89.5 µs99 µs

Passed

test_getattr
tests/benchmarks/test_attribute_access.py::test_getattr
CodSpeed Performance Gauge
+1%
55.9 µs55.5 µs
test_model_validators_serializers
tests/benchmarks/test_model_schema_generation.py::test_model_validators_serializers
CodSpeed Performance Gauge
+1%
768.7 µs763.4 µs
test_list_of_models_validation[__init__]
tests/benchmarks/test_model_validation.py::test_list_of_models_validation[__init__]
CodSpeed Performance Gauge
0%
82 µs81.6 µs
test_simple_model_schema_generation
tests/benchmarks/test_model_schema_generation.py::test_simple_model_schema_generation
CodSpeed Performance Gauge
0%
614 µs611.4 µs
test_recursive_discriminated_union_with_base_model
tests/benchmarks/test_model_schema_generation_recursive.py::test_recursive_discriminated_union_with_base_model
CodSpeed Performance Gauge
0%
1.5 ms1.5 ms
test_simple_recursive_model_schema_generation
tests/benchmarks/test_model_schema_generation_recursive.py::test_simple_recursive_model_schema_generation
CodSpeed Performance Gauge
0%
620.7 µs619 µs
test_simple_model_validation[model_validate]
tests/benchmarks/test_model_validation.py::test_simple_model_validation[model_validate]
CodSpeed Performance Gauge
0%
39.8 µs39.7 µs
test_nested_recursive_model_schema_generation
tests/benchmarks/test_model_schema_generation_recursive.py::test_nested_recursive_model_schema_generation
CodSpeed Performance Gauge
0%
1.5 ms1.5 ms
test_north_star_validate_json
tests/benchmarks/test_north_star.py::test_north_star_validate_json
CodSpeed Performance Gauge
0%
39.2 ms39.2 ms
test_construct_dataclass_schema
tests/benchmarks/test_model_schema_generation.py::test_construct_dataclass_schema
CodSpeed Performance Gauge
0%
1.1 ms1.1 ms
test_list_of_models_serialization
tests/benchmarks/test_model_serialization.py::test_list_of_models_serialization
CodSpeed Performance Gauge
0%
58.3 µs58.3 µs
test_failed_rebuild
tests/benchmarks/test_model_schema_generation.py::test_failed_rebuild
CodSpeed Performance Gauge
0%
215.9 µs215.6 µs
test_north_star_validate_json_strict
tests/benchmarks/test_north_star.py::test_north_star_validate_json_strict
CodSpeed Performance Gauge
0%
39.1 ms39.1 ms
test_fastapi_startup_perf
tests/benchmarks/test_fastapi_startup_generics.py::test_fastapi_startup_perf
CodSpeed Performance Gauge
0%
84.5 ms84.4 ms
test_tagged_union_with_str_discriminator_schema_generation
tests/benchmarks/test_model_schema_generation.py::test_tagged_union_with_str_discriminator_schema_generation
CodSpeed Performance Gauge
0%
1 ms1 ms
test_schema_build
tests/benchmarks/test_discriminated_unions.py::test_schema_build
CodSpeed Performance Gauge
0%
2.6 ms2.6 ms
test_tagged_union_with_callable_discriminator_schema_generation
tests/benchmarks/test_model_schema_generation.py::test_tagged_union_with_callable_discriminator_schema_generation
CodSpeed Performance Gauge
0%
1.1 ms1 ms
test_simple_model_schema_lots_of_fields_generation
tests/benchmarks/test_model_schema_generation.py::test_simple_model_schema_lots_of_fields_generation
CodSpeed Performance Gauge
0%
22 ms22 ms
test_recursive_model_schema_generation
tests/benchmarks/test_model_schema_generation.py::test_recursive_model_schema_generation
CodSpeed Performance Gauge
0%
841.8 µs841.5 µs
test_north_star_dump_python
tests/benchmarks/test_north_star.py::test_north_star_dump_python
CodSpeed Performance Gauge
0%
18.6 ms18.6 ms
test_north_star_dump_json
tests/benchmarks/test_north_star.py::test_north_star_dump_json
CodSpeed Performance Gauge
0%
30.2 ms30.1 ms
test_nested_model_schema_generation
tests/benchmarks/test_model_schema_generation.py::test_nested_model_schema_generation
CodSpeed Performance Gauge
0%
825.8 µs825.8 µs
test_lots_of_models_with_lots_of_fields
tests/benchmarks/test_model_schema_generation.py::test_lots_of_models_with_lots_of_fields
CodSpeed Performance Gauge
0%
2 s2 s
test_complex_model_validation[model_validate]
tests/benchmarks/test_model_validation.py::test_complex_model_validation[model_validate]
CodSpeed Performance Gauge
0%
51.4 µs51.4 µs
test_north_star_json_loads
tests/benchmarks/test_north_star.py::test_north_star_json_loads
CodSpeed Performance Gauge
0%
19.6 ms19.6 ms
test_model_json_serialization
tests/benchmarks/test_model_serialization.py::test_model_json_serialization
CodSpeed Performance Gauge
0%
49.9 µs50 µs
test_efficiency_with_highly_nested_examples
tests/benchmarks/test_discriminated_unions.py::test_efficiency_with_highly_nested_examples
CodSpeed Performance Gauge
0%
727.6 µs728 µs
test_north_star_validate_python_strict
tests/benchmarks/test_north_star.py::test_north_star_validate_python_strict
CodSpeed Performance Gauge
0%
23.9 ms23.9 ms
test_nested_recursive_generic_model_schema_generation
tests/benchmarks/test_model_schema_generation_recursive.py::test_nested_recursive_generic_model_schema_generation
CodSpeed Performance Gauge
0%
1.4 ms1.4 ms
test_import_field
tests/benchmarks/test_imports.py::test_import_field
CodSpeed Performance Gauge
0%
25.9 µs25.9 µs
test_deeply_nested_recursive_model_schema_generation
tests/benchmarks/test_model_schema_generation_recursive.py::test_deeply_nested_recursive_model_schema_generation
CodSpeed Performance Gauge
0%
1.3 ms1.3 ms
test_complex_model_serialization
tests/benchmarks/test_model_serialization.py::test_complex_model_serialization
CodSpeed Performance Gauge
0%
45 µs45 µs
test_fastapi_startup_perf
tests/benchmarks/test_fastapi_startup_simple.py::test_fastapi_startup_perf
CodSpeed Performance Gauge
0%
19.8 ms19.8 ms
test_complex_model_schema_generation
tests/benchmarks/test_model_schema_generation.py::test_complex_model_schema_generation
CodSpeed Performance Gauge
0%
1.5 ms1.5 ms
test_north_star_validate_python
tests/benchmarks/test_north_star.py::test_north_star_validate_python
CodSpeed Performance Gauge
0%
39 ms39.1 ms
test_generic_recursive_model_schema_generation
tests/benchmarks/test_model_schema_generation_recursive.py::test_generic_recursive_model_schema_generation
CodSpeed Performance Gauge
0%
742.4 µs743.9 µs
test_complex_model_validation[__init__]
tests/benchmarks/test_model_validation.py::test_complex_model_validation[__init__]
CodSpeed Performance Gauge
0%
50.2 µs50.3 µs
test_simple_model_serialization
tests/benchmarks/test_model_serialization.py::test_simple_model_serialization
CodSpeed Performance Gauge
0%
33.4 µs33.4 µs
test_nested_model_validation[model_validate]
tests/benchmarks/test_model_validation.py::test_nested_model_validation[model_validate]
CodSpeed Performance Gauge
-1%
50.6 µs50.9 µs
test_list_of_models_validation[model_validate]
tests/benchmarks/test_model_validation.py::test_list_of_models_validation[model_validate]
CodSpeed Performance Gauge
-1%
80.4 µs80.8 µs
test_simple_model_validation[__init__]
tests/benchmarks/test_model_validation.py::test_simple_model_validation[__init__]
CodSpeed Performance Gauge
-1%
37.2 µs37.4 µs
test_import_basemodel
tests/benchmarks/test_imports.py::test_import_basemodel
CodSpeed Performance Gauge
-1%
25.9 µs26.1 µs
test_nested_model_validation[__init__]
tests/benchmarks/test_model_validation.py::test_nested_model_validation[__init__]
CodSpeed Performance Gauge
-1%
52.5 µs52.9 µs
test_isinstance_basemodel
tests/benchmarks/test_isinstance.py::test_isinstance_basemodel
CodSpeed Performance Gauge
-1%
26 ms26.3 ms
test_north_star_json_dumps
tests/benchmarks/test_north_star.py::test_north_star_json_dumps
CodSpeed Performance Gauge
-3%
23 ms23.6 ms

Ignored

test_nested_model_serialization
tests/benchmarks/test_model_serialization.py::test_nested_model_serialization
Ignored
CodSpeed Performance Gauge
-1%
42.6 µs42.9 µs
test_field_validators_serializers
tests/benchmarks/test_model_schema_generation.py::test_field_validators_serializers
Ignored
CodSpeed Performance Gauge
-14%
1.4 ms1.7 ms

Commits

Click on a commit to change the comparison range
Base
main
418c02e
-9.57%
Preserving cached properties post validate assignment
a3b2f20
9 days ago
© 2025 CodSpeed Technology
Home Terms Privacy Docs