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
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.
| benchmark | wrenjit ms | luajit -joff ms | luajit ms | vs -joff | vs luajit |
|---|---|---|---|---|---|
benchmarksgame_fannkuch_redux | 1789.7 | 1914.6 | 493.6 | 0.93× | 3.63× |
benchmarksgame_nbody | 848.4 | 367.5 | 31.8 | 2.31× | 26.69× |
benchmarksgame_spectral_norm | 17.0 | 218.7 | 10.2 | 0.08× | 1.68× |
benchmarksgame_mandelbrot | 68.3 | 255.4 | 21.6 | 0.27× | 3.15× |
benchmarksgame_fasta | 54.7 | 31.7 | 10.4 | 1.73× | 5.25× |
benchmarksgame_k_nucleotide | 175.4 | 56.7 | 30.9 | 3.09× | 5.68× |
benchmarksgame_reverse_complement | 12.2 | 20.5 | 7.702 | 0.59× | 1.58× |
benchmarksgame_binary_trees | 206.5 | 83.0 | 48.6 | 2.49× | 4.25× |
benchmarksgame_pidigits | 66.4 | 340.0 | 119.8 | 0.20× | 0.55× |
benchmarksgame_regex_redux | 455.9 | 202.1 | 23.9 | 2.26× | 19.06× |
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.