[vlc-devel] [PATCH] LUA: precompile with luac

John Freed john.freed.paris at gmail.com
Wed Feb 15 10:39:59 CET 2012


I see the problem but wonder if there might be a better solution. In
particular, as I understand Lua,  execution of a program basically consists
of two parts:
1) Loading. By this I mean reading the .lua file from disk and precompiling
via luac into bytecode.
2) Executing. By this I mean running the bytecode in the host's luac
virtual machine.

Step 2 is exactly the same speed for both lua and luac files. So the only
speed difference is the overhead involved in Step 1.

We've seen that while standard Lua might produce identical luac files
across 32-bit architectures, and perhaps across 64-bit as well, the luac
files differ between 32 and 64 bit. It also seems clear to me that Lua
(because it doesn't offer the ability to create 32-bit luac files using the
64-bit precompiler) is intended to be used on the host system and isn't
well designed for cross-compiling.

One solution is to fork Lua.

Another, it seems to me, is to load *time critical* lua files when VLC
starts. These could be placed in a special lua/init directory. By
performing Step #1 above during VLC startup, the speed issues noted by Rémi
disappear.

I think it's tremendously advantageous to distribute lua files rather than
luac files. For one, it encourages people to write their own, and to make
minor local modifications where necessary. Neither is feasible with luac
files.

For another, it avoids the problem of either forking Lua or waiting for
upstream to make fixes.



On Wed, Feb 15, 2012 at 9:52 AM, <vlc-devel-request at videolan.org> wrote:
>
> Message: 3
> Date: Wed, 15 Feb 2012 09:12:40 +0100
> From: R?mi Denis-Courmont <remi at remlab.net>
> To: Mailing list for VLC media player developers
>        <vlc-devel at videolan.org>
> Subject: Re: [vlc-devel] [PATCH] LUA: precompile with luac
> Message-ID: <482b6b20d03fac50f58e2c9ef0b47fc0 at chewa.net>
> Content-Type: text/plain; charset=UTF-8
>
> On Tue, 14 Feb 2012 12:14:37 -0500, Rafa?l Carr? <funman at videolan.org>
> wrote:
> > Le 2012-02-14 03:27, R?mi Denis-Courmont a ?crit :
> >> On Mon, 13 Feb 2012 21:39:24 -0500, Rafa?l Carr?
> >> <rafael.carre at gmail.com>
> >> wrote:
> >>> Le 2010-02-14 14:09, R?mi Denis-Courmont a ?crit :
> >>>> ---
> >>>>  share/Makefile.am |   64
> >>>>  +++++++++++++++++++++++++++++++++++++++++++++++-----
> >>>>  1 files changed, 57 insertions(+), 7 deletions(-)
> >>>
> >>> Do we need this at all?
> >>
> >> Yes.
> >
> > Why?
>
> Because it is faster.
>
> --
> R?mi Denis-Courmont
> http://www.remlab.net/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20120215/fd5cf940/attachment.html>


More information about the vlc-devel mailing list