-
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
Replace definitions Vec
with OnceLock
slots
#992
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #992 +/- ##
==========================================
+ Coverage 92.98% 93.04% +0.05%
==========================================
Files 106 106
Lines 15827 15701 -126
Branches 35 35
==========================================
- Hits 14717 14609 -108
+ Misses 1103 1085 -18
Partials 7 7
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
CodSpeed Performance ReportMerging #992 will improve performances by 14.1%Comparing Summary
Benchmarks breakdown
|
ea8ed50
to
705618e
Compare
705618e
to
cddcc71
Compare
I've pushed a follow-up commit which removes validator cloning, to close #843 |
please review |
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.
Given the lack of changes to tests this looks good to me!
Change Summary
This PR reworks the way definitions work so that instead of storing them in a global
Vec
they are shared insideArc
s with aOnceLock
internally meaning that there is one opportunity to build them.The hope is that this transformation may pave the way for reusing
SchemaValidator
inside core schema as a compiled subgraph to reduce memory consumption and simplify the defs transformations needed inpydantic
.Related issue number
Related to pydantic/pydantic#7617
Checklist
pydantic-core
(except for expected changes)Selected Reviewer: @samuelcolvin