Comment

Comment by sstephenson

Performance depends on what toolset you’re using and how large your data set is.

For small JSON documents, like a package.json file, jwalk is around ten times slower on my machine: 0.03 seconds, vs 0.004 seconds for jq.

For larger documents, like the 1.5 MB GitHub API response tree.json [1] in the jwalk corpus, jwalk on mawk takes 0.37 seconds vs jq’s 0.11 seconds, but jwalk uses just 1.18 MB of memory, vs jq’s 5.81 MB.

Other interpreted parsers don’t fare as well: JSON.awk [2], which only runs on gawk, takes 0.8 seconds and 27 MB to parse tree.json; JSON.sh [3] takes 201 (!) seconds and 43 (!) MB, and JSONPath.sh [4] takes 7.4 seconds and uses 1.7 MB.

[1] https://raw.githubusercontent.com/shellbound/jwalk/master/te...

[2] https://github.com/step-/JSON.awk

[3] https://github.com/dominictarr/JSON.sh

[4] https://github.com/mclarkson/JSONPath.sh

parent sstephenson 7 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton