lua-users home
lua-l archive

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



> On Behalf Of Trevor Powell
> People have previously talked on the list about issues with Lua's
speed on
> the PS2, with suggestions about switching Lua to use floats instead of
> doubles, and so forth, but nobody seems to have posted any hard
> performance numbers.

On the PS2: Switching to floats from doubles is a no brainer as the PS2
has no hardware double support. It's well known the s/w double support
is slow. It will also use less memory as the basic type carries a union
which carries the Lua number type. Also convert longs to ints as the
64bit PS2 long value is unnecessary.

There are no performance numbers as it depends entirely on what you are
doing. You can look at comparisons with other languages, and you'll be
pleasantly surprised that Lua (on average), for its code size uses less
memory and runs faster than most other scripting languages. (See links
off wiki).

Your main design concern is where to draw the line between script and
code (C/C++). How much game is in Lua and how much in C++? If everything
is running too slow and profiling indicates Lua is a hog, you are
running too much Lua script, so you need to convert some logic back into
C++. However, you'll get excellent productivity benefits developing in
Lua instead of C++ (data driven/no compile & link time).

Nick