Markov text generation
Train a bigram Markov model on a 1 MiB corpus and emit 10,000 words.
Runtime · median per inner-loop window
Full statistics
| Runner | N | Compile | Runtime | P95 | Stddev | RSS | vs piko | Status |
|---|---|---|---|---|---|---|---|---|
| Native Gocompiled | 10 | 181 ms | 5.42 ms | 6.07 ms | 456 µs | 68 MiB | 0.23× | OK |
| Piko interpbytecode VM | 10 | 1.05 ms | 23.7 ms | 24.7 ms | 355 µs | 255 MiB | 1.00× | OK |
| CPython 3.13bytecode VM | 10 | 354 µs | 27.2 ms | 27.6 ms | 496 µs | n/a | 1.14× | OK |
| PyPy 7.3tracing JIT | 10 | 314 µs | 9.49 ms | 9.77 ms | 128 µs | n/a | 0.40× | OK |
| tengobytecode VM | 10 | 239 µs | 62.8 ms | 72.2 ms | 6.63 ms | 451 MiB | 2.65× | OK |
| scriggobytecode VM | 10 | 413 µs | 56.2 ms | 74.4 ms | 7.09 ms | 428 MiB | 2.37× | OK |
| mvmbytecode VM | 10 | 334 µs | 62.7 ms | 79.5 ms | 6.14 ms | 66 MiB | 2.64× | OK |
| yaegiAST walker | 10 | 374 µs | 58.3 ms | 67.0 ms | 9.31 ms | 66 MiB | 2.46× | OK |
Workload & symmetry rules
Workload
Build a bigram model from a 1 MiB lorem corpus. Sample 10,000 tokens from a deterministic LCG-seeded RNG. Print a fingerprint of the output.
Symmetry rules
- Hand-rolled LCG (no
randomC module, nomath/rand). - Hash map of (prev → counts) built from a byte-loop tokeniser.
Source code
piko / Go
piko_source.gonative Go
native_main.goCPython / PyPy
cpython.pytengo
script.tengo