-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
By default JMESPath#search caches parsed expressions in order to improve performance. However, it also takes care to call #optimize on each expression. The optimized expressions are not cached, meaning that for every #search the optimization takes place.
According to my (limited) tests, caching the optimized expressions increases the performance by 10-30 times.
I see two ways to solve this;
- Cache the optimized expressions within
Runtime, instead of caching the non-optimized expressions in theCachingParser, or - Make
#optimizememoize its result, so that sub-sequent calls can return the value directly without the overhead
I'll happily help with the coding, but wanted to get some feedback first.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels