WrenJIT Performance

Small compiler. Hard guards. Measured honestly.

Every benchmark below exists twice: once in Wren, once in Lua, written to do the same work in the same shape. Both print their own elapsed time. Process startup is excluded; WrenJIT warmup and compilation are included. Each bar is the best timing recorded in the input results. Shorter is better.

wren (jit) wren (no jit) luajit (-joff) luajit

Where things stand

WrenJIT is faster than LuaJIT on 1 of 10 paired kernels in this run. Loops use typed SSA traces. Exact recursive bytecode shapes use guarded native kernels. Range sums and alternating boolean counters are reduced as recurrences instead of paid one iteration at a time. A failed proof exits to the Wren interpreter.

benchmarkwrenjit msluajit -joff msluajit msvs -joffvs luajit
benchmarksgame_fannkuch_redux1789.71914.6493.60.93×3.63×
benchmarksgame_nbody848.4367.531.82.31×26.69×
benchmarksgame_spectral_norm17.0218.710.20.08×1.68×
benchmarksgame_mandelbrot68.3255.421.60.27×3.15×
benchmarksgame_fasta54.731.710.41.73×5.25×
benchmarksgame_k_nucleotide175.456.730.93.09×5.68×
benchmarksgame_reverse_complement12.220.57.7020.59×1.58×
benchmarksgame_binary_trees206.583.048.62.49×4.25×
benchmarksgame_pidigits66.4340.0119.80.20×0.55×
benchmarksgame_regex_redux455.9202.123.92.26×19.06×

Benchmarks

benchmarksgame_fannkuch_redux

Permutation flips from the Benchmarks Game, scaled to n=10.

wren (jit)
1789.7ms
wren (no jit)
7282.6ms
luajit (-joff)
1914.6ms
luajit
493.6ms

The JIT compiled 3 native units and aborted 9.

benchmarksgame_nbody

Five-body solar-system simulation, scaled to 500,000 time steps.

wren (jit)
848.4ms
wren (no jit)
2002.0ms
luajit (-joff)
367.5ms
luajit
31.8ms

The JIT compiled 2 native units and aborted 4.

benchmarksgame_spectral_norm

Spectral norm of a 500-element implicit matrix.

wren (jit)
17.0ms
wren (no jit)
652.8ms
luajit (-joff)
218.7ms
luajit
10.2ms

The JIT compiled 3 native units and aborted 3.

benchmarksgame_mandelbrot

Mandelbrot kernel at 600×600; output is reduced to a pixel checksum.

wren (jit)
68.3ms
wren (no jit)
701.9ms
luajit (-joff)
255.4ms
luajit
21.6ms

The JIT compiled 1 native unit and aborted 2.

benchmarksgame_fasta

FASTA linear-congruential generator over 500,000 symbols; output is checksummed.

wren (jit)
54.7ms
wren (no jit)
77.6ms
luajit (-joff)
31.7ms
luajit
10.4ms

The JIT compiled 2 native units and aborted 2.

benchmarksgame_k_nucleotide

K-mer counts over 250,000 deterministic bases.

wren (jit)
175.4ms
wren (no jit)
172.7ms
luajit (-joff)
56.7ms
luajit
30.9ms

The JIT compiled no native units and aborted 3 recording attempts.

benchmarksgame_reverse_complement

In-place reverse complement of one million encoded bases.

wren (jit)
12.2ms
wren (no jit)
68.5ms
luajit (-joff)
20.5ms
luajit
7.702ms

The JIT compiled 2 native units and aborted 1.

benchmarksgame_binary_trees

Binary-tree allocation and traversal through depth 14.

wren (jit)
206.5ms
wren (no jit)
266.7ms
luajit (-joff)
83.0ms
luajit
48.6ms

The JIT compiled 1 native unit and aborted 2.

benchmarksgame_pidigits

Array spigot producing 2,000 digits without a bignum extension.

wren (jit)
66.4ms
wren (no jit)
1190.2ms
luajit (-joff)
340.0ms
luajit
119.8ms

The JIT compiled 2 native units and aborted 22.

benchmarksgame_regex_redux

The nine regex-redux variant patterns using the same mask matcher in both languages.

wren (jit)
455.9ms
wren (no jit)
535.6ms
luajit (-joff)
202.1ms
luajit
23.9ms

The JIT compiled 1 native unit and aborted 7.

What is compiled

The loop compiler removes Wren dispatch, boxing, redundant guards, and loop-carried memory traffic. The recursive compiler accepts only complete, validated kernels: Fibonacci, linear recursion, mutual parity, Ackermann, Takeuchi, and binary-tree construction/traversal. This is specialization, not wishful inlining. Unsupported code remains ordinary Wren.

Measured on arm on 2026-08-08.
Wren base 99d2f0b, LuaJIT 2.1.1785763465 -- Copyright (C) 2005-2026 Mike Pall. https://luajit.org/.
Generated by bench/gen_report.py from bench/run_benchmarks.py --json. Source: github.com/Lulzx/WrenJIT.