Closed maikelmclauflin closed 5 years ago
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.
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