Online appendix

The Extended Green Side of the Lua

Interpreters, JIT, and AOT Compilation Under One Moon

  • Diogo Matosa,∗,†
  • André Brandãoa,†
  • Miguel Guimarãesa,†
  • Simão Cunhaa,b
  • João Saraivaa,b

a University of Minho, Braga, Portugal · b HASLab/INESC TEC, Braga, Portugal

∗ Corresponding author

† These authors contributed equally to this work.

26

Lua execution environments benchmarked, plus a C baseline

30

Programs across 5 suites: LuaAOT, LuaMatrix, LuaFun, Collections, OO Classes

6.6×

Less Package energy for official LuaJIT vs. the best interpreter

5.6×

Remaining energy gap between LuaJIT 2.0.4 and native C

Graphical abstract

One workload, three execution models

Graphical abstract showing the experimental setup, benchmark suites, RAPL measurement flow, and main findings

Abstract

In a nutshell

Context: Programming languages and their execution models significantly influence software runtime performance and energy consumption. Although interpreted dynamic languages like Lua are widely adopted, they have historically ranked poorly in multi-language energy efficiency rankings compared to compiled languages.

Objectives: This paper investigates how Lua's runtime performance and energy consumption evolve across 17 interpreter releases, 8 JIT compiler versions, and an AOT compiler. We also examine how these execution models compare against C.

Methods: We conducted a large-scale empirical study evaluating 26 Lua execution environments across 5 benchmark suites covering diverse computational and programming patterns, alongside C evaluated on the LuaAOT suite. We measured CPU Package and DRAM energy using Intel RAPL alongside execution times, evaluated gains using the GPS-UP sustainability metric suite, and performed battery endurance tests until complete battery depletion.

Results: Standard interpreters improved over time, with Lua 5.4.x/5.5.0 outperforming older 5.3.x versions (Lua 5.4.7 being the greenest interpreter). LuaAOT achieved moderate improvements, running 1.5× faster and greener than the best interpreter. JIT compilation dominated: the best LuaJIT release (LuaJIT 2.1) ran 6.3× faster and consumed 6.6× less energy than Lua 5.4.7. Against C on the LuaAOT suite, LuaJIT 2.0.4 (the fastest and greenest release on that suite) narrowed the efficiency gap to 5.63× energy and 7.85× runtime (compared to 38.04× energy and 54.74× runtime for Lua 5.4.7). Battery tests confirmed that LuaJIT completed 5.7× more executions than the interpreter.

Conclusion: The poor standing of Lua in global energy rankings is largely an artifact of evaluating legacy interpreters. Adopting JIT compilation substantially improves both computational performance and environmental sustainability in dynamic languages.

Keywords: Green Software · Energy Efficiency · Benchmarking · Lua · Just-in-Time · Ahead-of-Time

Extended from: The Green Side of the Lua (Brandão et al., SANER 2026). This study adds the Lua 5.5.0 interpreter, the LuaJIT Remake project, the LuaAOT ahead-of-time execution model, and four additional benchmark suites built on widely used Lua libraries.

Research questions

What this study asks

RQ1

How do Lua's runtime performance and energy efficiency evolve across its official interpreter versions, JIT compiler releases and AOT compilation model?

RQ2

How do Lua's runtime performance and energy consumption across its execution models compare to C, the baseline for the most energy-efficient programming language?

At a glance

Highlights

  • Empirical evaluation of 26 Lua execution environments across five diverse benchmark suites.
  • Reference interpreters consistently improve in runtime and energy consumption across releases: every 5.4.x and 5.5.0 release beats every 5.3.x release.
  • The best LuaJIT release (LuaJIT 2.1) runs 6.3× faster and consumes 6.6× less energy than the best interpreter (Lua 5.4.7), reaching 9.8× Speedup and 11.0× Greenup over the Lua 5.3.1 baseline.
  • LuaAOT is an effective intermediate model (≈1.5× faster and greener than the best interpreter) but stays about 4× behind the official JIT releases.
  • LuaJIT narrows the gap against native C from 38.04× to 5.63× in energy and from 54.74× to 7.85× in runtime, advancing Lua by 5 positions in energy rankings.
  • No implementation — not even the JIT compilers — performs program fusion over composed higher-order pipelines.