Lua的绿色一面
The Green Side of the Lua
AI总结:
本文研究了Lua的能耗和性能,发现LuaJIT编译器在能耗和速度上显著优于标准解释器,接近C语言的效率。
摘要:
联合国2030可持续发展议程强调了能源高效软件在减少全球碳足迹方面的重要性。编程语言和执行模型强烈影响软件能耗,解释型语言通常比编译型语言效率低。Lua体现了这种权衡:尽管其受欢迎,但比更环保和更快的C等语言能耗更高。本文对Lua的运行时性能和能耗进行了实证研究,涵盖了25个官方解释器版本和即时编译器。使用全面的基准测试套件,我们测量执行时间和能耗,以分析Lua的演变、即时编译的影响以及与其他语言的比较。结果显示,所有LuaJIT编译器均显著优于标准Lua解释器。最高效的LuaJIT消耗的能耗约为最佳Lua解释器的七分之一,运行速度也快七倍。此外,LuaJIT接近C的效率,使用约六倍的能耗,运行速度慢约八倍,展示了即时编译在提高解释型语言性能和能耗方面的重要好处。
英文摘要:
The United Nations' 2030 Agenda for Sustainable Development highlights the importance of energy-efficient software to reduce the global carbon footprint. Programming languages and execution models strongly influence software energy consumption, with interpreted languages generally being less efficient than compiled ones. Lua illustrates this trade-off: despite its popularity, it is less energy-efficient than greener and faster languages such as C. This paper presents an empirical study of Lua's runtime performance and energy efficiency across 25 official interpreter versions and just-in-time (JIT) compilers. Using a comprehensive benchmark suite, we measure execution time and energy consumption to analyze Lua's evolution, the impact of JIT compilation, and comparisons with other languages. Results show that all LuaJIT compilers significantly outperform standard Lua interpreters. The most efficient LuaJIT consumes about seven times less energy and runs seven times faster than the best Lua interpreter. Moreover, LuaJIT approaches C's efficiency, using roughly six times more energy and running about eight times slower, demonstrating the substantial benefits of JIT compilation for improving both performance and energy efficiency in interpreted languages.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。