esquery icon indicating copy to clipboard operation
esquery copied to clipboard

Add memo cache to improve performance of repeated parse calls

Open phenomnomnominal opened this issue 6 years ago • 1 comments
trafficstars

I've got some code that repeatedly calls esquery.query() with the same selector. Obviously this can be quite slow, but instead of rewriting it all I figured it might be worth just caching internally. Keen for thoughts.

phenomnomnominal avatar Feb 27 '19 05:02 phenomnomnominal

As an aside, since tsquery uses esquery.parse , tsquery will get faster too!

phenomnomnominal avatar Feb 27 '19 05:02 phenomnomnominal