Generic numeric pipeline
Generic Sum / Max / Min over 500 slices each of uint32 and int64. Exercises type-parameterised dispatch.
Runtime · median per inner-loop window
Full statistics
| Runner | N | Compile | Runtime | P95 | Stddev | RSS | vs piko | Status |
|---|---|---|---|---|---|---|---|---|
| Native Gocompiled | 10 | 181 ms | 716 µs | 721 µs | 2.78 µs | 68 MiB | 0.03× | OK |
| Piko interpbytecode VM | 10 | 1.61 ms | 26.9 ms | 27.2 ms | 187 µs | 125 MiB | 1.00× | OK |
| CPython 3.13bytecode VM | 10 | 331 µs | 33.7 ms | 34.9 ms | 830 µs | n/a | 1.26× | OK |
| PyPy 7.3tracing JIT | 10 | 277 µs | 9.56 ms | 10.1 ms | 193 µs | n/a | 0.36× | OK |
| tengobytecode VM | 10 | 230 µs | 90.9 ms | 94.1 ms | 7.31 ms | 523 MiB | 3.38× | OK |
| scriggobytecode VM | 0 | n/a | n/a | n/a | n/a | n/a | n/a | unsupported |
| mvmbytecode VM | 10 | 417 µs | 55.5 ms | 57.2 ms | 912 µs | 62 MiB | 2.07× | OK |
| yaegiAST walker | 10 | 425 µs | 42.3 ms | 60.4 ms | 7.06 ms | 62 MiB | 1.57× | OK |
Workload & symmetry rules
Workload
Generate 500 slices of 100 uint32 values via LCG; apply GenericSum, GenericMax, GenericMin to each, XOR-folding results. Repeat with 500 slices of 100 int64 values, the same generic functions in a second instantiation. Total 6,000 generic dispatches per outer call, each iterating 100 elements.
Symmetry rules
- Go uses real
[T Numeric]generics; Python uses the equivalent duck-typed function (it has no separate generic-dispatch primitive, so the comparison is what Python's runtime cost looks like on the same workload).
Why this benchmark exists
Distinct from interface dispatch (bench 13) and closure dispatch (bench 17). Measures whether piko's generics path has competitive specialisation.
Source code
piko / Go
piko_source.gonative Go
native_main.goCPython / PyPy
cpython.pytengo
script.tengo