Dijkstra shortest paths
Shortest paths from one source over a 10k-node sparse graph using a binary heap.
Runtime · median per inner-loop window
Full statistics
| Runner | N | Compile | Runtime | P95 | Stddev | RSS | vs piko | Status |
|---|---|---|---|---|---|---|---|---|
| Native Gocompiled | 10 | 182 ms | 4.40 ms | 4.57 ms | 72.3 µs | 69 MiB | 0.04× | OK |
| Piko interpbytecode VM | 10 | 2.01 ms | 112 ms | 115 ms | 1.00 ms | 193 MiB | 1.00× | OK |
| CPython 3.13bytecode VM | 10 | 529 µs | 89.8 ms | 91.4 ms | 1.56 ms | n/a | 0.80× | OK |
| PyPy 7.3tracing JIT | 10 | 437 µs | 37.4 ms | 39.6 ms | 719 µs | n/a | 0.33× | OK |
| tengobytecode VM | 10 | 393 µs | 160 ms | 162 ms | 2.28 ms | 1.03 GiB | 1.43× | OK |
| scriggobytecode VM | 10 | 643 µs | 147 ms | 166 ms | 7.09 ms | 431 MiB | 1.31× | OK |
| mvmbytecode VM | 0 | n/a | n/a | n/a | n/a | n/a | n/a | unsupported |
| yaegiAST walker | 10 | 682 µs | 292 ms | 368 ms | 28.9 ms | 74 MiB | 2.60× | OK |
Workload & symmetry rules
Workload
A 10,000-node directed graph with ~5 edges per node and integer weights 1..100. Dijkstra from node 0. Print the sum of all reachable distances.
Symmetry rules
- Hand-rolled binary heap (no
heapq.heappush, nocontainer/heap). - Adjacency stored as parallel slices / lists.
Source code
piko / Go
piko_source.gonative Go
native_main.goCPython / PyPy
cpython.pytengo
script.tengo