-
Notifications
You must be signed in to change notification settings - Fork 252
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
Simplify shared union serializer logic #1538
Conversation
CodSpeed Performance ReportMerging #1538 will not alter performanceComparing Summary
|
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.
Looking great! I think we can go a bit further for fun and profit 😄
Failing integration test is unrelated to this PR, should be resolved soon once we merge pydantic/pydantic#10825 into |
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 looks like a solid improvement to me! 🎉
@sydney-runkle did you try running CodSpeed in Pydantic side for this PR? I accidentally rebased my changes on top of pydantic-core ❌ test_north_star_dump_json 31.7 ms 57.9 ms -45.26% |
I think the benchmarks we have here should have identified if this PR was a problem, but it's not impossible it could slip through. |
This PR should in theory have no functional change so definitely that order of magnitude seems incorrect. |
@davidhewitt / @sydney-runkle it is still showing the exactly same here: pydantic/pydantic#10845 🤔 Weird... |
Huh, that is really odd. @davidhewitt, I might defer to you here - not sure why our changes here would degrade perf... |
include, | ||
exclude, | ||
match tagged_union_serialize( | ||
None, |
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.
@sydney-runkle this is the source of the perf regression; accidentally switched off tagged union serialization optimization in the JSON case.
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.
😬 oops. Great find!
No description provided.