Quirrel4.53.0

Performance

This page has one set of benchmarks. It is measured on Windows x64, and it is committed with the numbers it produced.

Every row times the benchmarked code only, without interpreter startup and without compilation. Each workload repeats the load inside one process and keeps its best time, because the best time has the least noise from other work on the machine.

Each language has its own port of every workload, written as an expert writes current code in that language: modern Quirrel with import, const and pure functions; Squirrel 3.2 as Squirrel; Lua 5.5 with constants and integers; Luau with type annotations; modern JavaScript. All ports do the same work with the same algorithm and the same data shapes, and use only the generic containers of their language. Each workload except fibonacci-loop and float2string prints its result, and the harness checks that all interpreters computed the same one. Quirrel and Squirrel use 32-bit floats and the others use 64-bit floats, so their float results agree to about three digits.

Luau is measured at its three optimization levels, -O0, -O1 (the default) and -O2, because the level changes its speed a lot on some workloads: exp-loop is 2.7 times faster at -O1 than at -O0, and spectral-norm is 1.8 times faster at -O2 than at -O1.

Each cell in Benchmarks below is measured three times. The harness starts three processes one after another, all pinned to the same logical CPU, and the page shows the fastest of the three.

The page shows the fastest run because noise only makes a run slower. A process can share its core with other work, land on an efficiency core, or get an unlucky code alignment. None of these makes it faster. The core alone changes the result by tens of percent on this hardware.

The harness also checks how far the three runs are apart. It reports a spread of more than five percent when the runs also differ by more than five milliseconds, because on a row that takes tens of milliseconds the clock alone accounts for a few percent. A reported row is measured again on an idle machine.

LuaJIT is measured with the JIT off. Quirrel, Lua and QuickJS are built for platforms where generating code at runtime is not allowed, such as consoles and phones, so a comparison against a JIT would not be useful.

If you need the fastest interpreter, or an AOT language, use Daslang, which has more benchmarks of this kind. Quirrel, Lua and JS are highly dynamic and much quicker to learn, so this page compares those.

Benchmarks

Shorter bars are better.

n-bodies

LuaJIT-2.1-joff
0.490s
Luau-0.735-O2
0.587s
Luau-0.735-O1
0.589s
Luau-0.735-O0
0.751s
Lua-5.5.1
0.957s
Quirrel-4.44.1
QuickJS-ng-0.16.2
1.791s
Squirrel-3.2
2.353s

n-bodies-arrays

LuaJIT-2.1-joff
0.448s
Luau-0.735-O2
0.521s
Luau-0.735-O1
0.523s
Lua-5.5.1
0.767s
Luau-0.735-O0
0.820s
Quirrel-4.44.1
QuickJS-ng-0.16.2
2.212s
Squirrel-3.2
2.273s

particles-kinematics

LuaJIT-2.1-joff
0.153s
Luau-0.735-O0
0.184s
Luau-0.735-O1
0.184s
Luau-0.735-O2
0.184s
Lua-5.5.1
0.282s
QuickJS-ng-0.16.2
0.413s
Quirrel-4.44.1
Squirrel-3.2
1.256s

exp-loop

LuaJIT-2.1-joff
0.163s
Luau-0.735-O2
0.185s
Luau-0.735-O1
0.194s
Quirrel-4.44.1
Lua-5.5.1
0.366s
Luau-0.735-O0
0.517s
QuickJS-ng-0.16.2
0.730s
Squirrel-3.2
0.793s

dictionary

LuaJIT-2.1-joff
0.197s
Luau-0.735-O2
0.410s
Luau-0.735-O1
0.414s
Luau-0.735-O0
0.420s
Lua-5.5.1
0.530s
Quirrel-4.44.1
Squirrel-3.2
0.875s
QuickJS-ng-0.16.2
1.829s

darg-ui-benchmark

Luau-0.735-O2
0.088s
Luau-0.735-O1
0.092s
LuaJIT-2.1-joff
0.107s
Quirrel-4.44.1
Luau-0.735-O0
0.189s
Lua-5.5.1
0.260s
Squirrel-3.2
0.348s
QuickJS-ng-0.16.2
0.406s

fibonacci-recursive

LuaJIT-2.1-joff
0.057s
Luau-0.735-O1
0.083s
Luau-0.735-O2
0.083s
Lua-5.5.1
0.083s
Luau-0.735-O0
0.087s
Quirrel-4.44.1
QuickJS-ng-0.16.2
0.171s
Squirrel-3.2
0.243s

fibonacci-loop

LuaJIT-2.1-joff
0.030s
Lua-5.5.1
0.036s
Luau-0.735-O0
0.048s
Luau-0.735-O1
0.048s
Quirrel-4.44.1
Luau-0.735-O2
0.057s
Squirrel-3.2
0.151s
QuickJS-ng-0.16.2
0.220s

primes-loop

LuaJIT-2.1-joff
0.067s
Lua-5.5.1
0.083s
Luau-0.735-O2
0.101s
Luau-0.735-O1
0.101s
Quirrel-4.44.1
QuickJS-ng-0.16.2
0.193s
Luau-0.735-O0
0.232s
Squirrel-3.2
0.327s

float2string

Luau-0.735-O1
0.064s
Luau-0.735-O2
0.064s
Luau-0.735-O0
0.103s
LuaJIT-2.1-joff
0.175s
Quirrel-4.44.1
QuickJS-ng-0.16.2
0.426s
Squirrel-3.2
0.575s
Lua-5.5.1
0.812s

string2float

Quirrel-4.44.1
Luau-0.735-O1
0.135s
Luau-0.735-O2
0.135s
LuaJIT-2.1-joff
0.159s
QuickJS-ng-0.16.2
0.169s
Lua-5.5.1
0.177s
Luau-0.735-O0
0.178s
Squirrel-3.2
0.197s

queen

LuaJIT-2.1-joff
0.001s
Lua-5.5.1
0.002s
Luau-0.735-O2
0.002s
Luau-0.735-O1
0.002s
Luau-0.735-O0
0.002s
Quirrel-4.44.1
QuickJS-ng-0.16.2
0.004s
Squirrel-3.2
0.004s

sort

Luau-0.735-O2
0.052s
Luau-0.735-O1
0.052s
Luau-0.735-O0
0.053s
QuickJS-ng-0.16.2
0.059s
LuaJIT-2.1-joff
0.062s
Lua-5.5.1
0.075s
Quirrel-4.44.1
Squirrel-3.2
0.241s

spectral-norm

Luau-0.735-O2
0.233s
LuaJIT-2.1-joff
0.302s
Luau-0.735-O1
0.427s
Lua-5.5.1
0.430s
Luau-0.735-O0
0.441s
Quirrel-4.44.1
Squirrel-3.2
1.074s
QuickJS-ng-0.16.2
1.215s

tree

LuaJIT-2.1-joff
0.287s
Luau-0.735-O2
0.328s
Luau-0.735-O1
0.348s
Luau-0.735-O0
0.354s
Lua-5.5.1
0.468s
Quirrel-4.44.1
QuickJS-ng-0.16.2
1.094s
Squirrel-3.2
1.904s

Measured on AMD64 Family 23 Model 49 Stepping 0, AuthenticAMD, Windows-10-10.0.19045-SP0 (10), 2026-10-28. Best iteration of 3 process runs.

What was built, and how

Everything is built for Windows 64-bit with clang-cl where the source allows it. The Quirrel rows measure the release build of csq, the console interpreter of the Dagor engine tree, which is the shipped runtime configuration: clang with whole program optimization, and mimalloc. A build on the CRT heap, such as a plain cmake sq.exe, is up to twice as slow on table-sweep workloads, so it would not measure shipped performance. csq runs with closure hoisting on, as the game runtime does.

The third-party interpreters are committed next to their workloads. Each is a release console exe that imports KERNEL32 only. Two of them need a change to get their jump-table interpreter loop, because both gate it on __GNUC__, which clang-cl does not define. Lua takes -DLUA_USE_JUMPTABLE=1. In QuickJS the line #if defined(EMSCRIPTEN) || defined(_MSC_VER) becomes #if defined(EMSCRIPTEN) || (defined(_MSC_VER) && !defined(__clang__)). Without the QuickJS change the primes workload takes twice as long, which measures the MSVC command line and not QuickJS.

LuaJIT has one source change, so that a short repetition can be timed: os.clock() reads the performance counter, because the CRT clock() ticks once per millisecond, which is about the time one rep takes.

Sources

Every workload, harness and prebuilt interpreter is in bench/ next to doc/ in the Dagor engine tree, under prog/1stPartyLibs/quirrel/quirrel, one folder per language: bench/quirrel, bench/squirrel, bench/lua, bench/luajit, bench/luau, bench/js.

benchmarks.py needs the Windows interpreters, so the numbers are refreshed by hand and committed. The site itself builds anywhere. bench/README.md says how to run them and how each committed binary was built.