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

Caching for strings / numbers / booleans #1727

Closed
maikelmclauflin opened this issue Feb 15, 2019 · 1 comment
Closed

Caching for strings / numbers / booleans #1727

maikelmclauflin opened this issue Feb 15, 2019 · 1 comment
Assignees
Labels
feature New functionality or improvement
Milestone

Comments

@maikelmclauflin
Copy link

Describe the problem you are trying to fix (provide as much context as possible)

with complex string checking like regex, especially when there are many at the bottom of objects, it may make more sense to cache results of schema if this is not being done to decrease execution time.

Which API (or modification of the current API) do you suggest to solve that problem ?

anything that checks a non object / non array / serializable data structure for the first part, to optionally speed up large object values that generally do not change over time. cache could be scoped to the validator itself or to an identity created by the validator

Are you ready to work on a pull request if your suggestion is accepted ?

yes

@hueniverse
Copy link
Contributor

The hard part isn't the caching but memory management. Need to create something that is effective but that does not create potential problems with an ever growing map of values to results. I think starting with a plugable API that lets you hook a cache into validation seems best. I'll try to come up with something.

@hueniverse hueniverse self-assigned this Jun 2, 2019
@hueniverse hueniverse added this to the 16.0.0 milestone Jun 25, 2019
@hueniverse hueniverse changed the title Caching for strings / numbers / immutables Caching for strings / numbers / booleans Jun 30, 2019
@hueniverse hueniverse added the v16 label Aug 10, 2019
@hueniverse hueniverse added feature New functionality or improvement and removed request labels Sep 19, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants