Skip to content

Benchmarks ​

The Benchmarks workflow runs sequentially on Ubuntu runners under headless luau 0.748 across both --codegen -O2 (matching Roblox native codegen) and -O2 interpreter execution. Before timing any workload, docs/benchmarks/bench.py runs --verify to confirm exact output parity against host Luau loadstring.

Results ​

Ouro vs Fiu vs LuauCeption native codegen benchmark

Ouro vs Fiu vs LuauCeption interpreter benchmark

Raw timing, cold-require, and code-footprint metrics are published alongside the SVG charts in results.json on the assets branch.

Capabilities ​

CapabilityOuroFiuLuauCeption (0.654)
Lexer & lossless ASTYes (reconstruct(), :text(), :formatDiagnostics())NoC++/WASM only
Luau 0.748 bytecode compiler (O0–O2)Yes (pure Luau)NoLuau 0.654 via WASM
Bytecode disassembler & verifierYes (v3–v14 verified, uniform (val?, err?))Deserializes onlyC++/WASM only
Sandboxed register VMDual @native fast / guardedInterpreter loopWASM C VM (lua_State)
Safe-by-default presets & budgetsBuilt-in (Ouro.run, Ouro.sandbox, PRESETS, ResourceLimits)Custom hooks onlyCustom C setup
Per-environment RNG & getGlobal/setGlobalBuilt-in (PCG32, cross-sandbox debug/getfenv isolation)Manual metatable envManual metatable env
Runtime architecturePure --!strict LuauPure LuauEmscripten WASM in Luau

What's Measured ​

Every run exercises four stages defined in docs/benchmarks/run.luau:

  • Warm VM execution (13 workloads): Mixed loops and coroutines (vm-suite), 100k arithmetic (arith-100k), recursive fib(24) (fib-24), 20k upvalue closures (closures-20k), 5k metatable method calls (tables-meta-5k), 20k math fastcalls (imports-20k), 20k global reads and writes (globals-20k), 2k throwing pcall frames (pcall-2k), 20k ipairs scans (forin-gen-20k), 2,000-element quicksort (quicksort-2k), 10k string formatting (string-ops-10k), 10k select vararg calls (varargs-10k), and 20k dictionary field updates (table-dict-20k).
  • O2 compilation (5 corpora): Full source-to-O2 bytecode timing across tiny-120B, runtime-10KiB, runtime-50KiB, runtime-250KiB, and types-50KiB (measuring Ouro's lexer, parser, compiler, and full compile against LuauCeption's WASM compiler), plus Ouro bytecode deserialize and loadBytecode latency across 10–250 KiB.
  • Cold load + run (cold-load-run): Fresh environment or VM state per invocation followed by a 1k arithmetic loop.
  • Cold root require (cold-require): Subprocess require latency comparing Ouro's lazy facade against eager competitor modules (Fiu/Source.lua and LuauCeption/Full.luau), plus Ouro's incremental lazy module loads (VM, Parser, Compiler).

Methodology ​

  • Sampling: Warmed median (p50) over 7 runs (5 for fib-24 and runtime-250KiB; 9 for cold-load-run; 3 subprocess samples for cold-require). Treat gaps under roughly 10% as run-to-run microbenchmark variance.
  • Fair sandbox configuration: Ouro executes in its default isolated environment (VM.createEnvironment()), with Ouro (guarded) enforcing instructionLimit = 50_000_000. Fiu (fast) configures errorHandling = false, reuseClosures = true, vectorCtor = vector.create, and static useImportConstants = true on all non-global workloads. LuauCeption runs inside luaL_sandbox(L) on all non-global workloads.
  • Handling pcall-2k: LuauCeption throws Infinity in WASM C++ exception handling when guest errors unwind inside pcall (pcall-2k). Its bar renders as DNF (error) on the full charts, and its VM geometric mean averages the 12 completed workloads without adding an arbitrary timeout penalty.
  • Per-row normalization: Geometric means normalize each row to its fastest completed entry (1.0×). Bars exceeding 10× fade out cleanly and print the true multiple.

Reproducing ​

Run parity verification or the self-contained Ouro suite locally without third-party dependencies:

sh
python3 docs/benchmarks/bench.py --verify
luau --codegen -O2 docs/benchmarks/run.luau

Or run the sequential 3-way runner against pinned local copies of Fiu and LuauCeption to produce results.json and render chart-small.svg, chart.svg, and chart-interp.svg:

sh
python3 docs/benchmarks/bench.py --verify --fiu /path/to/Fiu/Source.lua --luauception /path/to/luauception
python3 docs/benchmarks/bench.py --fiu /path/to/Fiu/Source.lua --luauception /path/to/luauception
python3 docs/benchmarks/chart.py