Last active
July 9, 2020 03:18
-
-
Save TuvianNavy/54de2e66d889d70a22a7fa6b38f647ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ubuntu@livazplus:~/Desktop/parse-json-benchmark$ lscpu --json | /home/ubuntu/go/bin/gojq -c .lscpu[12] | |
| {"data":"Intel(R) Core(TM) i3-7100U CPU @ 2.40GHz","field":"Model name:"} | |
| ubuntu@livazplus:~/Desktop/parse-json-benchmark$ free -h | |
| total used free shared buff/cache available | |
| Mem: 31G 648M 25G 526M 5.3G 29G | |
| Swap: 2.0G 1.2M 2.0G | |
| ubuntu@livazplus:~/Desktop/parse-json-benchmark$ yq --version | |
| yq 2.10.1 | |
| ubuntu@livazplus:~/Desktop/parse-json-benchmark$ gojq -v | |
| gojq 0.11.0 (rev: HEAD/go1.14.4) | |
| ubuntu@livazplus:~/Desktop/parse-json-benchmark$ wc -l citylots.json | |
| 206560 citylots.json | |
| ubuntu@livazplus:~/Desktop/parse-json-benchmark$ # citylots.json is indeed jsonl and can't feed yq, so convert it first | |
| ubuntu@livazplus:~/Desktop/parse-json-benchmark$ jq -s . citylots.json | pv -f > citilots-converted.json | |
| 334MiB 0:00:23 [14.3MiB/s] [ <=> ] | |
| ubuntu@livazplus:~/Desktop/parse-json-benchmark$ ls -lh citylots.json citilots-converted.json | |
| -rw-rw-r-- 1 ubuntu ubuntu 335M Jul 9 10:57 citilots-converted.json | |
| -rw-rw-r-- 1 ubuntu ubuntu 153M Jul 9 02:12 citylots.json | |
| ubuntu@livazplus:~/Desktop/parse-json-benchmark$ jq '.|length' citilots-converted.json | |
| 206560 | |
| ubuntu@livazplus:~/Desktop/parse-json-benchmark$ gojq --yaml-output . citilots-converted.json | pv -f > /run/user/1000/gojq-convert.yml | |
| 240MiB 0:00:48 [4.92MiB/s] [ <=> ] | |
| ubuntu@livazplus:~/Desktop/parse-json-benchmark$ yq --yaml-output . citilots-converted.json | pv -f > /run/user/1000/yq-convert.yml | |
| 240MiB 0:33:05 [ 123KiB/s] [ <=> ] | |
| ubuntu@livazplus:~/Desktop/parse-json-benchmark$ ls -lh citylots.json citilots-converted.json /run/user/1000/gojq-convert.yml /run/user/1000/yq-convert.yml | |
| -rw-rw-r-- 1 ubuntu ubuntu 335M Jul 9 10:57 citilots-converted.json | |
| -rw-rw-r-- 1 ubuntu ubuntu 153M Jul 9 02:12 citylots.json | |
| -rw-rw-r-- 1 ubuntu ubuntu 241M Jul 9 11:18 /run/user/1000/gojq-convert.yml | |
| -rw-rw-r-- 1 ubuntu ubuntu 241M Jul 9 11:52 /run/user/1000/yq-convert.yml | |
| ubuntu@livazplus:~/Desktop/parse-json-benchmark$ time gojq --yaml-input '.|length' /run/user/1000/gojq-convert.yml | |
| 206560 | |
| real 0m52.079s | |
| user 1m0.276s | |
| sys 0m2.470s | |
| ubuntu@livazplus:~/Desktop/parse-json-benchmark$ time gojq --yaml-input '.|length' /run/user/1000/yq-convert.yml | |
| 206560 | |
| real 0m51.974s | |
| user 0m58.521s | |
| sys 0m2.589s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment