lua-users home
lua-l archive

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


On Wed, May 6, 2015 at 10:38 PM, Brigham Toskin <brighamtoskin@gmail.com> wrote:
> The more general question: Where do we draw the line between writing simple
> code, and performance? Or phrased another way, how slow is too slow, for the
> sake of an elegant design? When I optimized the ADT code, it got uglier and
> more complex. When I optimized the coroutine prototype, it got simpler and
> more elegant.


that kind of questions were a nice debate in the last LuaWorkshop,
where several people, both speakers and public, was in the "i have
this Lua code, i need more performance, try LuaJIT, and it's great at
first, but then things get ugly, or much slower than the original
Lua!"

my case was roughly: "yes, you can get _amazing_ performance out of
LuaJIT, but your code will read like C (except for the readable
keywords)".  it can still be very readable, but not the same as plain
Lua

Roberto's position was "Lua and LuaJIT are different languages, pick
one".  a corollary is that optimizing for one is different from
optimizing for the other.

Hisham's position was "you can write very compatible code that will
run nicely on Lua 5.1, 5.2, 5.3, LuaJIT 1.0, 2.0, 2.1.   aim for
readability/maintainability, it will be fast enough for almost any
need"

this is of course, a summary, and you can check the videos for longer
arguments, and most people there are also here, so they'll likely
correct me and restart the discussion! :-)

-- 
Javier