Repository navigation
Reuse property patterns during object validation - #96
Merged
Merged
Conversation
Compile pattern coverage once per validation call after the first field without a literal property, and check coverage without materializing match objects. Preserve public matching and error-path behavior and bound allocations on wide objects. AI disclosure: This work was prepared with assistance from OpenAI Codex.
Use the Boolean regex predicate in the remaining pattern-property existence check; nested validation does not use captures. All public and full-package tests pass on the minimum and current Julia versions. AI disclosure: This work was prepared with assistance from OpenAI Codex.
Member
Author
|
Merged as AI disclosure: This work was prepared with assistance from OpenAI Codex. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Objects validated with
patternPropertiesand restrictiveadditionalPropertiescompiled the same regular expressions for each field and created match objects just to check coverage. Reuse compiled patterns during each validation call and use Boolean matching for both coverage checks and pattern-property validation.Compilation starts only when a field is not covered by
properties. The cache lasts for one call, so later schema changes do not require cache invalidation. Literal properties, overlapping and unanchored patterns, Unicode keys, nested schemas, and error locations keep their existing behavior.Validation:
git diff --checkpass. An independent private review covered the complete change and its callers.additionalProperties=false, seven warmed median samples. This measures wide objects with a small pattern set; it is not a universal speed claim.Empty objects retain the same measured allocations. Objects covered by literal properties and patterns also avoid unnecessary match allocations. All seven hosted checks pass at
d4516f6f5cc87e0f50bff11bbddf8223298e0a94. Each of the six native jobs passed its suite and accepted a coverage upload for the correct repository and commit; all six reports finished processing, with aggregate coverage at 96.46%. The ordinary squash merge is38a74fd1026bdc1e7f7936a5b3b3d5ca74d20133, whose tree equals the tested head. Both main workflows and all seven jobs pass; all six main uploads were also accepted and processed at 96.46%.Co-authored by Codex
AI disclosure: This work was prepared with assistance from OpenAI Codex.