lua-users home
lua-l archive

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


Do you plan to be able to specify the return type(s) of functions? It wouldn't always be possible with the dynamic nature of Lua functions, but if a function always returned the same number/types of data, it could eliminate some runtime checks.

On Sun, May 24, 2015 at 5:59 PM, Dibyendu Majumdar <mobile@majumdar.org.uk> wrote:
Hi,

I found a matrix multiplication benchmark which I adapted for Ravi.
The original benchmark is from:

http://attractivechaos.github.io/plb/

C:\github\ravi\ravi-tests>\luajit\luajit.exe matmul2.lua 1000
time taken      0.968
-95.5835833333

C:\github\ravi\ravi-tests>..\build\Release\lua.exe  matmul1.ravi 1000
time taken      4.2
-95.5835833333

C:\github\ravi\ravi-tests>\lua-5.3.0\src\build\Release\lua.exe matmul1.lua 1000
time taken      34.604
-95.5835833333


The Ravi version uses array slices that I have been playing around
with. The idea is to allow more efficient [] operator access.

For the source code for above benchmarks see:

https://github.com/dibyendumajumdar/ravi/tree/master/ravi-tests

For a full list of benchmarks and Ravi's performance at present, please see:

https://github.com/dibyendumajumdar/ravi/blob/master/readthedocs/ravi-benchmarks.rst


Regards
Dibyendu




--
Brigham Toskin