davesnx / query-json

Faster, simpler and more portable implementation of `jq` in Reason

Home Page:https://query-json.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jq is ~2 times faster in no-filter mode

pvonmoradi opened this issue · comments

I ran a test on a 3.8MiB json file with hyperfine.

hyperfine --export-markdown a.md -r 3 \
    './query-json '.'  channels.json' \
    'jq '.'  channels.json'
Command Mean [ms] Min [ms] Max [ms] Relative
./query-json . channels.json 485.8 ± 1.4 484.4 487.2 1.93 ± 0.01
jq . channels.json 251.2 ± 0.4 250.9 251.7 1.00
Summary
  'jq .  channels.json' ran
    1.93 ± 0.01 times faster than './query-json .  channels.json'
$ jq --version && ./query-json --version
jq-1.5-1-a5b5cbe
0.5.13

Hey @pvonmoradi

Thanks for opening the issue, even there's no issue here.

The benchmarks that I made with big JSON files are around 90M and there the performance is similar. Would be nice to have this benchmark as part of the repo, please feel free to add it and I will keep an eye on it.

Thanks again.