public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* Progress on Ravi - a Lua 5.3 derivative
@ 2015-01-01  0:00 Dibyendu Majumdar
  2015-01-01  0:00 ` David Malcolm
  0 siblings, 1 reply; 3+ messages in thread
From: Dibyendu Majumdar @ 2015-01-01  0:00 UTC (permalink / raw)
  To: jit

Hi

Ravi is a Lua 5.3 derived language with support for JIT compilation. I
started this project back in January this year - my aim was to see if
an alternative to LuaJIT was possible. LuaJIT is a very fast JIT
implementation for Lua - it uses trace compilation techniques to
achieve near C like performance even though Lua is a dynamic language.

As I wanted a relatively simple and easy to maintain JIT
implementation I decided from the outset that I was going to use
standard method based JIT. But this posed the problem that in a
dynamic language the JIT compilation only achieves a factor of 2 or 3
times improvement over the interpreter. To overcome this issue I opted
to add optional static types in Lua so that performance sensitive
operations - mainly to do with numeric values and arrays - could be
optimised.

My initial JIT implementation was based on LLVM. And now I am working
on a port of LLVM implementation to libgccjit. Thanks to the
simplicity of the implementation the port is estimated to be complete
by July (I started 2nd week of June). As of now several Lua/Ravi
bytecodes are implemented and I am able to run some of my performance
benchmarks.

I am pleased to say that libgccjit performance seems comparable to
LLVM so far. For details of the benchmarks please see:

http://the-ravi-programming-language.readthedocs.org/en/latest/ravi-benchmarks.html

The benchmark programs are:

https://github.com/dibyendumajumdar/ravi/blob/master/ravi-tests/fornum_test1.lua
https://github.com/dibyendumajumdar/ravi/blob/master/ravi-tests/fornum_test2.ravi
https://github.com/dibyendumajumdar/ravi/blob/master/ravi-tests/mandel1.ravi

The implementation falls back on the interpreter when it cannot JIT
compile a function.

For details regarding the status of libgccjit implementation please visit:

http://the-ravi-programming-language.readthedocs.org/en/latest/ravi-jit-libgccjit.html

I am grateful for all the support provided by Dave both on and off this forum.

Thanks and Regards

Dibyendu

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Progress on Ravi - a Lua 5.3 derivative
  2015-01-01  0:00 Progress on Ravi - a Lua 5.3 derivative Dibyendu Majumdar
@ 2015-01-01  0:00 ` David Malcolm
  2015-01-01  0:00   ` Dibyendu Majumdar
  0 siblings, 1 reply; 3+ messages in thread
From: David Malcolm @ 2015-01-01  0:00 UTC (permalink / raw)
  To: Dibyendu Majumdar; +Cc: jit

On Sun, 2015-06-28 at 21:12 +0100, Dibyendu Majumdar wrote:
> Hi
> 
> Ravi is a Lua 5.3 derived language with support for JIT compilation. I
> started this project back in January this year - my aim was to see if
> an alternative to LuaJIT was possible. LuaJIT is a very fast JIT
> implementation for Lua - it uses trace compilation techniques to
> achieve near C like performance even though Lua is a dynamic language.
> 
> As I wanted a relatively simple and easy to maintain JIT
> implementation I decided from the outset that I was going to use
> standard method based JIT. But this posed the problem that in a
> dynamic language the JIT compilation only achieves a factor of 2 or 3
> times improvement over the interpreter. To overcome this issue I opted
> to add optional static types in Lua so that performance sensitive
> operations - mainly to do with numeric values and arrays - could be
> optimised.
> 
> My initial JIT implementation was based on LLVM. And now I am working
> on a port of LLVM implementation to libgccjit. Thanks to the
> simplicity of the implementation the port is estimated to be complete
> by July (I started 2nd week of June). As of now several Lua/Ravi
> bytecodes are implemented and I am able to run some of my performance
> benchmarks.
> 
> I am pleased to say that libgccjit performance seems comparable to
> LLVM so far. For details of the benchmarks please see:
> 
> http://the-ravi-programming-language.readthedocs.org/en/latest/ravi-benchmarks.html
> 
> The benchmark programs are:
> 
> https://github.com/dibyendumajumdar/ravi/blob/master/ravi-tests/fornum_test1.lua
> https://github.com/dibyendumajumdar/ravi/blob/master/ravi-tests/fornum_test2.ravi
> https://github.com/dibyendumajumdar/ravi/blob/master/ravi-tests/mandel1.ravi
> 
> The implementation falls back on the interpreter when it cannot JIT
> compile a function.
> 
> For details regarding the status of libgccjit implementation please visit:
> 
> http://the-ravi-programming-language.readthedocs.org/en/latest/ravi-jit-libgccjit.html
> 
> I am grateful for all the support provided by Dave both on and off this forum.
> 
> Thanks and Regards

Thanks for posting this.

If I may be so bold, the benchmark table isn't quite apples-to-apples:
it has gccjit running in a guest vm, but everything else running on bare
metal, putting gccjit at a slight disadvantage.  Currently a reader has
to make it down to the final bullet point to see that.  Is it possible
to emphasize that a bit? (e.g. change the table header to read "Ravi
(gccjit; guest vm)".

FWIW, it might be worth stating the versions of LLVM and gccjit in use.

Hope this is constructive
Dave


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Progress on Ravi - a Lua 5.3 derivative
  2015-01-01  0:00 ` David Malcolm
@ 2015-01-01  0:00   ` Dibyendu Majumdar
  0 siblings, 0 replies; 3+ messages in thread
From: Dibyendu Majumdar @ 2015-01-01  0:00 UTC (permalink / raw)
  To: David Malcolm; +Cc: jit

On 29 June 2015 at 20:19, David Malcolm <dmalcolm@redhat.com> wrote:
> On Sun, 2015-06-28 at 21:12 +0100, Dibyendu Majumdar wrote:
>> I am pleased to say that libgccjit performance seems comparable to
>> LLVM so far. For details of the benchmarks please see:
>>
>> http://the-ravi-programming-language.readthedocs.org/en/latest/ravi-benchmarks.html
>>
> If I may be so bold, the benchmark table isn't quite apples-to-apples:
> it has gccjit running in a guest vm, but everything else running on bare
> metal, putting gccjit at a slight disadvantage.  Currently a reader has
> to make it down to the final bullet point to see that.  Is it possible
> to emphasize that a bit? (e.g. change the table header to read "Ravi
> (gccjit; guest vm)".

Done.

>
> FWIW, it might be worth stating the versions of LLVM and gccjit in use.
>

Done.

Regards

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-29 20:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-01  0:00 Progress on Ravi - a Lua 5.3 derivative Dibyendu Majumdar
2015-01-01  0:00 ` David Malcolm
2015-01-01  0:00   ` Dibyendu Majumdar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).