[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: When is Lua already very efficient by itself?
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 23 Aug 2011 10:16:48 +0200
On Tue, Aug 23, 2011 at 10:07 AM, Dirk Laurie <firstname.lastname@example.org> 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
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.