Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1.71 KB

lua-benchmark.md

File metadata and controls

32 lines (23 loc) · 1.71 KB

Lua Versions Benchmarks

This infographic measures the speed of Lua's virtual machine with the same script on each Lua version.

The script calls recursive factorial function with number 16 1000000 times. The benchmark was run on x64 Windows machine with 4 cores. All executables were 64-bit.

Used script:

The variety of version is meant to follow nature coding style in Lua. Example: repeat until was used in Lua 1.0 until for statement was introduced in 4.0.

Benchmark uses Windows API for measuring the elapsed time. The result of the benchmark is a median value of 50 runs using recorder script.

Runtime

Lua Versions Benchmarks

Conclusion:

  • Lua 5.4 beat the speed record after version 1.1. In comparison, latest LuaJIT runs this script for 85.4ms when JIT-compiled, and for 370.3ms when JIT is off. (Lua 5.4.1 runs for 490.8ms)

Compile-time

Lua Versions Benchmarks

Conclusion:

  • Compiling time is pretty much stable for the entire Lua development.