lua-users home
lua-l archive

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

On 29 January 2015 at 02:50, Dibyendu Majumdar <> wrote:
> I have implemented a couple of array types in Ravi - these are just
> specializations of the Lua table type.
> The two array types as of now are:
> local var : int[] = {}
> declares an integer array.
> local var: double[] = {}
> declares a double array.


I wanted to give an update on where I have got to and what I have found so far.

As of now, I have implemented the ability to specify following types
for local variables:


I have implemented additional opcodes that are specialized for these types.

I terms of performance I am getting following results:

For a modified mandelbrot benchmark (links below) I am seeing about
10% improvement on Windows 64-bit. (benchmark modified to suppress

For a modified fannkuchen benchmark I am seeing about 20% improvement
on Windows 64-bit (The Ravi version was modified to hardcoded
parameter 11, so the benchmark should be run with this).

My conclusion is that the interpreter performance is bounded by the
bytecode dispatch mechanism. I have not tried computed gotos as this
is orthogonal to the approach I have taken anyway.

My hope is that with the more specialized bytecodes I will be able to
get greater performance when the code is JITed. Once I have ironed out
any bugs I will look at implementing a JIT compiler. As I do not want
to have to write this for every platform I am planning to use one of
the existing JIT libraries to generate the code. (I am considering
LLVM and GNU Lightning, but will also look at libjit, nanojit, and any

Assuming that I do get the performance I need once I have implemented
JIT compilation, I will get back to adding support for additional
types. The reason for this approach is to limit my investment until
the benefits are clear.


Here are the bytecode listings for Ravi:

Thanks and Regards