Skip to content

Instantly share code, notes, and snippets.

@TuvianNavy
Last active July 9, 2020 01:33
Show Gist options
  • Select an option

  • Save TuvianNavy/cd50e8b46e01591c5f451bdba154b739 to your computer and use it in GitHub Desktop.

Select an option

Save TuvianNavy/cd50e8b46e01591c5f451bdba154b739 to your computer and use it in GitHub Desktop.
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ /home/ubuntu/go/bin/gojq -v
gojq 0.11.0 (rev: HEAD/go1.14.4)
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ /home/ubuntu/go/bin/gojq --yaml-input . /etc/netplan/01-network-manager-all.yaml
{
"network": {
"ethernets": {
"enp2s0": {
"addresses": [
"192.168.179.99/24"
],
"gateway4": "192.168.179.1",
"nameservers": {
"addresses": [
"192.168.179.1"
]
}
}
},
"renderer": "NetworkManager",
"version": 2
}
}
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ pwd
/home/ubuntu/Desktop/parse-json-benchmark
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ git config --get remote.origin.url
https://github.com/netj/parse-json-benchmark
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ uname -a
Linux livazplus 5.3.0-62-generic #56~18.04.1-Ubuntu SMP Wed Jun 24 16:17:03 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
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$ git diff
diff --git a/Makefile b/Makefile
index ecc8840..d2206ca 100644
--- a/Makefile
+++ b/Makefile
@@ -18,17 +18,19 @@ DATA ?= signalmedia-1m.jsonl
# implementations
IMPL += parse-json.jq
+IMPL += parse-json.gojq
+IMPL += parse-json-docker.gojq
IMPL += parse-json-xs.pl
IMPL += parse-json-pp.pl
IMPL += parse-json-json.py2
IMPL += parse-json-json.py3
-IMPL += parse-json-json.pypy
-IMPL += parse-json-ujson.py2
+#IMPL += parse-json-json.pypy
+#IMPL += parse-json-ujson.py2
IMPL += parse-json-ujson.py3
-IMPL += parse-json-ujson.pypy
-IMPL += parse-json-simplejson.py2
+#IMPL += parse-json-ujson.pypy
+#IMPL += parse-json-simplejson.py2
IMPL += parse-json-simplejson.py3
-IMPL += parse-json-simplejson.pypy
+#IMPL += parse-json-simplejson.pypy
# measurement outputs
MEASUREMENT_EXTENSION = .throughput
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ cat parse-json.gojq
#!/usr/bin/env bash
exec /home/ubuntu/go/bin/gojq empty >/dev/null
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ cat parse-json-docker.gojq
#!/usr/bin/env bash
exec docker run -i itchyny/gojq empty >/dev/null
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ du -h citylots.json
153M citylots.json
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ jq -V
jq-1.5-1-a5b5cbe
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ make
# citylots.json with parse-json.jq
# citylots.json with parse-json.jq: 0:00:05 [22.4MiB/s]
# citylots.json with parse-json.gojq
# citylots.json with parse-json.gojq: 0:00:05 [21.5MiB/s]
# citylots.json with parse-json-docker.gojq
read unix @->/var/run/docker.sock: read: connection reset by peer
# citylots.json with parse-json-docker.gojq: 0:00:05 [14.8MiB/s]
# citylots.json with parse-json-xs.pl
# citylots.json with parse-json-xs.pl: 0:00:05 [53.4MiB/s]
# citylots.json with parse-json-pp.pl
# citylots.json with parse-json-pp.pl: 0:00:05 [1.28MiB/s]
# citylots.json with parse-json-json.py2
# citylots.json with parse-json-json.py2: 0:00:05 [31.6MiB/s]
# citylots.json with parse-json-json.py3
# citylots.json with parse-json-json.py3: 0:00:05 [36.7MiB/s]
# citylots.json with parse-json-ujson.py3
# citylots.json with parse-json-ujson.py3: 0:00:05 [75.1MiB/s]
# citylots.json with parse-json-simplejson.py3
# citylots.json with parse-json-simplejson.py3: 0:00:05 [32.6MiB/s]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment