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

Switch to another jsonpath library #8

Closed
nuclearspike opened this issue May 1, 2016 · 1 comment
Closed

Switch to another jsonpath library #8

nuclearspike opened this issue May 1, 2016 · 1 comment

Comments

@nuclearspike
Copy link

nuclearspike commented May 1, 2016

The JSONPath library is notoriously slow for queries. In a 5000 item array, telling it to fetch index 400 takes 5 seconds on my rather fast laptop. The "jsonpath" library is orders of magnitude faster. When I tested it to just find items matching a predicate with the same list, it took 6ms.

When using queries in templates in this library therefore suffer the same terrible performance. Having it perform a query that was selective (filtering by properties then returning only the ids of the matching items) jsonpath took 14 milliseconds while JSONPath took 37 seconds. It's not just a little bit faster but the difference is so significant that JSONPath should be shut down or fixed because it's simply not good enough for production quality code.

JSONPath has some additional syntax outside of the spec, but I don't think they are needed for most transforms. JSONPath (by the test I mentioned) is 2700x slower. Nobody should be using that library.

@dvdln
Copy link
Owner

dvdln commented May 3, 2016

I think this approach is a little better. You pick your own parser—jsonPath or not

@dvdln dvdln closed this as completed Sep 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants