[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Challenges in JIT compiling Lua
- From: Leonardo <leob@...>
- Date: Thu, 23 Feb 2017 10:39:04 -0500
Compiling specialized versions of a function for specific types
definitely gives a big performance boost. To my knowledge, it's not
uncommon for JIT compilers to do this sort of thing. We're currently
working on adding this to Lua Vermelha and should have a working
prototype pretty soon.
Leonardo
On 21/02/17 06:52 PM, Dibyendu Majumdar wrote:
> So while great performance can be obtained by providing type
> annotations in Ravi, if no annotations are provided then the results
> are not very good. Only about 2x improvement is achieved whereas when
> type annotations are present, 10x improvement is possible.
>
> The problem is that existing Lua programs cannot benefit from the
> performance improvements.
>
> So I have the idea that now that Ravi has type specialised byte codes,
> it is possible to think of doing following:
>
> Specialise a Lua function by observing the types during execution.
> JIT compile the specialised version.
> This will require being able to switch back to interpreting if the
> types turn out not as expected - thankfully due to the way Lua works,
> this should be possible to do.
>
> Seems doable except that I don't know when I will have the time to
> work on this.
>
> Regards
> Dibyendu
>