-
Notifications
You must be signed in to change notification settings - Fork 253
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
stop clone-ing serializers #1402
stop clone-ing serializers #1402
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1402 +/- ##
==========================================
- Coverage 90.21% 89.53% -0.69%
==========================================
Files 106 109 +3
Lines 16339 17345 +1006
Branches 36 41 +5
==========================================
+ Hits 14740 15529 +789
- Misses 1592 1796 +204
- Partials 7 20 +13
... and 34 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
CodSpeed Performance ReportMerging #1402 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.
Great! It's cool to learn about new rust concepts through reviewing your PRs.
I'd be happy to open a PR like this tomorrow for validators, if you think that would help as well :).
While the offer is welcome, actually I did a similar change already for validators in 5f14973 Though in the same line, what we should try to work towards is resolving this TODO: Lines 30 to 32 in 7368c1f
Last I checked the hard bit is that we clone error values; we might be able to restructure errors to remove the need. |
Change Summary
In general, cloning serializers is a potentially expensive runtime operation; we should instead store
Arc<CombinedSerializer>
and cheaply clone that where needed.Related issue number
N/A
Checklist
pydantic-core
(except for expected changes)