lua-users home
lua-l archive

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


On Tue, Aug 23, 2011 at 10:07 AM, Dirk Laurie <dpl@sun.ac.za> wrote:
>    Does the Lua/LuaJIT time ratio in general tell one how
>    efficient Lua is relative to a near-optimal implementation?

OK, you have a case where the program is mostly just calling a library
function, so we are probably only measuring differences of
implementation here.

What's interesting is that LuaJIT makes other solutions suddenly much
more optimal. In plain Lua we would lean on string.match; in LuaJIT we
could do a more C-like solution and get serious improvements.   As a
practical example, markdown.lua uses string functions heavily, and it
does not scale very well (takes about 4 seconds to build the
unofficial FAQ for instance); LuaJIT would not really improve that
time. To do better would require another way of approaching the
problem, and that new approach could benefit from LuaJIT optimization.

steve d.