|
> Even though Python isn't the fastest language out there, it's likely still faster than the shell command above. Taking these two command lines: jo -p name=JP object=$(jo fruit=Orange point=$(jo x=10 y=20) number=17) sunday=false >/dev/null
python -c 'import json;print(json.dumps({"name": "JP", "object": {"fruit": "Orange", "point": {"x": 10, "y": 20}, "number": 17}, "sunday": False}))' >/dev/null
For jo (x86_64, Rosetta2), python2 (x86_64, Rosetta2), jo (arm64), and python3 (arm64), running 1000 iterations, with `tai64n` doing the timing. 2022-02-05 21:25:38.357228500 start-jo-x86
2022-02-05 21:25:45.319337500 stop-jo
2022-02-05 21:25:45.319338500 start-python2-x86
2022-02-05 21:26:18.876235500 stop-python2-x86
2022-02-05 21:26:18.876235500 start-jo-arm
2022-02-05 21:26:22.316063500 stop-jo-arm
2022-02-05 21:26:22.316064500 start-python3-arm
2022-02-05 21:26:40.379063500 stop-python3-arm
I make it: 7s for jo-x86, 33.5s for python2-x86, 3.5s for jo-arm, 18s for python3-arm.Test script is at https://pastebin.com/4tTVrDia |