Skip to content
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

Performance: Cache format: regex #417

Closed
Stranger6667 opened this issue Feb 13, 2023 · 0 comments · Fixed by #546
Closed

Performance: Cache format: regex #417

Stranger6667 opened this issue Feb 13, 2023 · 0 comments · Fixed by #546

Comments

@Stranger6667
Copy link
Owner

The idea comes from #416. It might make sense to keep some shared LRU cache for the format: regex validator.

Assumption: compiling regex on each validation is expensive, but input regexes are often repeated.

Hash lookups for String will be much less expensive than compiling a regex, so we can make one extra lookup every validation in hope that regex is already cached (and translated to JS style).

It could be schema-level or even global.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant