Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Do not reuse validators and serializers during model rebuild#11429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
cloudflare-workers-and-pagesbot commentedFeb 11, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Deploying pydantic-docs with |
Latest commit: | 059a706 |
Status: | ✅ Deploy successful! |
Preview URL: | https://414fc1ce.pydantic-docs.pages.dev |
Branch Preview URL: | https://model-rebuild-val-ser.pydantic-docs.pages.dev |
codspeed-hqbot commentedFeb 11, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
CodSpeed Performance ReportMerging#11429 willdegrade performances by 7.16%Comparing Summary
Benchmarks breakdown
|
0e62bfd
to638708f
CompareCoverage reportClick to see where and how coverage changed
This report was generated bypython-coverage-comment-action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I approve of these logical change, but I'm equally perplexed by the benchmark changes.
I think we should investigate before merging, but obviously this should make its way into v2.11.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
As we look for `cls.__pydantic_validator/serializer__` inpydantic-core, we don't want to mistakenly reuse them.
638708f
to059a706
CompareSo I'm still not sure why the performance difference comes from pydantic-core: But I now realize it was just improved by the reusable validators/serializers in pydantic-core (see#11402), which doesn't make sense for benchmarks such as pydantic/tests/benchmarks/test_model_schema_generation.py Lines 36 to 42 ina1f12c7
|
Yeah, this regression is a bit mysterious. Though, it seems like for cases with nested models, we still see all of the perf wins that we wanted to from previous improvements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This fix is necessary, and I believe we've diagnosed the codspeed changes as not blocking here.@Viicos if you can acknowledge them in codspeed, happy to merge this.
53f8ece
intomainUh oh!
There was an error while loading.Please reload this page.
As we look for
cls.__pydantic_validator/serializer__
in pydantic-core, we don't want to mistakenly reuse them.Change Summary
Related issue number
Checklist