lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Jun 18, 2018 at 11:33 PM, Luiz Henrique de Figueiredo wrote:
The focus of Lua 5.4.0 is performance.
We're especially interested in feedback about its performance.


I've tested the performance of one program under Lua 5.1 / 5.2 / 5.3 / 5.4
The program is just a calculator of SHA512 written for Lua 5.1, all bitwise operations are emulated with arithmetic.
The code is here:  https://stackoverflow.com/a/51561685/6834680 
(the code consists of two files: the module and the testing/benchmarking script)
 
All Lua executables under test are 64-bit, built with the same script under the same compiler.
So, the benchmarking is fair.
 
 
C:\>lua51.exe sha2for51_test.lua
CPU seconds:    12.371
 
C:\>lua52.exe sha2for51_test.lua
CPU seconds:    12.513
 
C:\>lua53.exe sha2for51_test.lua
CPU seconds:    16.801
 
C:\>lua54.exe sha2for51_test.lua
CPU seconds:    15.6

 
 
and one more time (to make sure there are no fluctuations here)
 
 
C:\>lua51.exe sha2for51_test.lua
CPU seconds:    12.356
 
C:\>lua52.exe sha2for51_test.lua
CPU seconds:    12.496
 
C:\>lua53.exe sha2for51_test.lua
CPU seconds:    16.88
 
C:\>lua54.exe sha2for51_test.lua
CPU seconds:    15.491

 
 
Two notes on this:
 
1)
Arithmetic computations written for Lua 5.1 appear to be 1.25 times slower in Lua 5.4 (compared to Lua 5.1)
(Probably, this happened because of heavy mixing of floats with integers in arithmetic expressions.)
 
2)
Lua 5.4 is 7-8% faster than Lua 5.3 !