lua-users home
lua-l archive

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


On 20 Feb 2008 08:19:05 -0500, John D. Ramsdell <ramsdell@mitre.org> wrote:
> It occurs to me that number intensive applications that rely only on
>  integral computations would enjoy a strong performance boost if run on
>  top of a version of Lua that uses integers for all its numerical
>  operations, instead of computing with doubles, and converting the
>  results to integers.

Do you have a quantitative evidence of this?
All my anecdotal experience is to the contrary of your statement.
Modern CPUs like x86 have very fast FPUs so that arithmetic operations
with double is very fast (one cycle or sometimes several ops/cycle
with parallel pipelines). In fact, floating point arithmetic is faster
that Lua VM operations. I doubt that changing lua_Number from 'double'
to 'int' will boost up Lua code execution speed.

--Leo--