-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
validate JSON model data by iteration #12550
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #12550 will degrade performances by 9.77%Comparing Summary
Benchmarks breakdown
|
Deploying pydantic-docs with
|
| Latest commit: |
c8387cc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a10d7aa4.pydantic-docs.pages.dev |
| Branch Preview URL: | https://dh-validate-by-iteration.pydantic-docs.pages.dev |
|
Seems like a decent win on the more targeted benchmark. The "north star" JSON validation benchmark seems to go through a wrap validator for URL validation, which seems to be a major contributor to the overall cost of validation. I'll see if I can optimize that another time. |
|
I will also see if I can refactor to reduce the schema build regression. |
Change Summary
Imported from pydantic/pydantic-core#1620
The idea here is that JSON data doesn't need to use map lookup, we can instead iterate through the found data. I build a lookup tree which handles this.
The code is almost right, needs a lot of cleanup. There are still some very minor differences due to handling of alias & in error messages, I believe these are resolvable.
Related issue number
This is going to be necessary for the "iteration" validation in #10032
Checklist