Mini JSON parse
Hand-rolled JSON parser over a 100 KiB document with mixed nesting.
Runtime · median per inner-loop window
Full statistics
| Runner | N | Compile | Runtime | P95 | Stddev | RSS | vs piko | Status |
|---|---|---|---|---|---|---|---|---|
| Native Gocompiled | 10 | 182 ms | 12.6 ms | 12.8 ms | 272 µs | 68 MiB | 0.06× | OK |
| Piko interpbytecode VM | 10 | 2.69 ms | 208 ms | 232 ms | 10.4 ms | 2.38 GiB | 1.00× | OK |
| CPython 3.13bytecode VM | 10 | 732 µs | 186 ms | 189 ms | 3.74 ms | n/a | 0.89× | OK |
| PyPy 7.3tracing JIT | 10 | 574 µs | 101 ms | 104 ms | 1.88 ms | n/a | 0.48× | OK |
| tengobytecode VM | 0 | n/a | n/a | n/a | n/a | n/a | n/a | unsupported |
| scriggobytecode VM | 0 | n/a | n/a | n/a | n/a | n/a | n/a | unsupported |
| mvmbytecode VM | 10 | 815 µs | 434 ms | 478 ms | 24.1 ms | 148 MiB | 2.09× | OK |
| yaegiAST walker | 10 | 732 µs | 2.14 s | 2.36 s | 86.5 ms | 1.13 GiB | 10.3× | OK |
Workload & symmetry rules
Workload
Parse a 100 KiB JSON document into a generic tree, then walk the tree and sum every integer node. Print the sum.
Symmetry rules
- Hand-rolled recursive-descent parser; no
encoding/json, nojson.loads. - Returns a tagged-union tree, walked by switch/match.
Source code
piko / Go
piko_source.gonative Go
native_main.goCPython / PyPy
cpython.py