-
Notifications
You must be signed in to change notification settings - Fork 0
Description
In JSONParseStream it uses minPathArrayLength and maxPathArrayLength as a quick way to determine "is it possible that this pop/push to the stack has made a JSONPath start/stop matching the current value". This works well if all your JSONPath queries are the same length, or at least close to the same length. Which is probably pretty common. But in the case where you have a really short and really long one, then this optimization stops doing much.
Instead, maybe you'd need to track all the JSONPath query lengths separately, or somehow more intelligently know when we can skip checking things.
Or maybe you could check each component of pathArray as we pop/push on the stack, and then probably very quickly know which ones have already failed and don't need to be checked until we pop above the point it failed. (This is what I originally wanted to do, but the current solution is a lot simpler and works 99% the same for my purposes.)