This repository was archived by the owner on Apr 11, 2026. It is now read-only.
Replace definitions Vec with OnceLock slots#992
Merged
davidhewitt merged 4 commits intomainfrom Sep 28, 2023
Merged
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
Collaborator
Author
|
I've pushed a follow-up commit which removes validator cloning, to close #843 |
Closed
Collaborator
Author
|
please review |
4 tasks
adriangb
approved these changes
Sep 27, 2023
Member
adriangb
left a comment
There was a problem hiding this comment.
Given the lack of changes to tests this looks good to me!
4 tasks
davidhewitt
added a commit
to pydantic/pydantic
that referenced
this pull request
Oct 22, 2025
…re#992) Original-commit-link: pydantic/pydantic-core@a8fb1e3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
This PR reworks the way definitions work so that instead of storing them in a global
Vecthey are shared insideArcs with aOnceLockinternally meaning that there is one opportunity to build them.The hope is that this transformation may pave the way for reusing
SchemaValidatorinside 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