Brainfuck interpreter
Interpreter-inside-interpreter: a host language interpreting a Brainfuck program. The purest measurement of dispatch cost we have.
Compile time · median (cold)
Full statistics
| Runner | N | Compile | Runtime | P95 | Stddev | RSS | vs pipit | Status |
|---|---|---|---|---|---|---|---|---|
| Native Gocompiled | 7 | 108 ms | 28.0 µs | 29.3 µs | 1.27 µs | 1.62 GiB | 108× | OK |
| Pipitbytecode VM | 7 | 1.00 ms | 163 µs | 951 µs | 276 µs | 591 MiB | 1.00× | OK |
| CPython 3.14bytecode VM | 7 | 396 µs | 357 µs | 361 µs | 5.51 µs | n/a | 0.39× | OK |
| PyPy 7.3tracing JIT | 7 | 302 µs | 2.56 ms | 2.68 ms | 55.5 µs | n/a | 0.30× | OK |
| tengobytecode VM | 7 | 245 µs | 11.9 ms | 12.2 ms | 180 µs | 1.69 GiB | 0.24× | OK |
| scriggobytecode VM | 7 | 271 µs | 536 µs | 871 µs | 171 µs | 1.69 GiB | 0.27× | OK |
| mvmbytecode VM | 7 | 344 µs | 1.74 ms | 1.82 ms | 34.4 µs | 1.69 GiB | 0.34× | OK |
| yaegiAST walker | 7 | 385 µs | 1.71 ms | 1.72 ms | 7.82 µs | 1.69 GiB | 0.38× | OK |
Workload & symmetry rules
Workload
Host language interprets a small Brainfuck program. Every BF instruction is one full dispatch through the host's interpreter loop. Output is a 32-bit fold over the emitted bytes.
Symmetry rules
- No third-party BF library, no eval-based execution, no threaded-code tricks.
- Bracket jump table built once at start.
- Switch / if-elif dispatch on opcode character.
Why this is the purest dispatch benchmark
Every BF instruction is one host-language switch + one memory access. A 2× faster dispatch loop is a 2× faster wall time. The workload has no library escape hatch.
Source code
pipit / Go
pipit_source.gonative Go
native_main.goCPython / PyPy
cpython.pytengo
script.tengo