Skip to content

Keep the parsed pattern property keys#3

Merged
jsoriano merged 2 commits intoelastic:package-specfrom
jsoriano:reuse-regexps
Mar 12, 2026
Merged

Keep the parsed pattern property keys#3
jsoriano merged 2 commits intoelastic:package-specfrom
jsoriano:reuse-regexps

Conversation

@jsoriano
Copy link
Member

Pattern property keys are evaluated for every property whose
name doesn't exactly match with a named property key.

Current implementation is compiling the regular expression of
each pattern once when loading the schema, and another one for
each property.

For reference, these compilations take around 15% of the total
execution time of a Package Spec validation, as found while
investigating elastic/package-spec#1110.

This change stores the compilation done when parsing the schema,
so it can be reused on validations later.

To be merged after #2.

@jsoriano jsoriano requested a review from a team March 12, 2026 16:43
@jsoriano jsoriano self-assigned this Mar 12, 2026
@jsoriano jsoriano merged commit a7d009f into elastic:package-spec Mar 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants