[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Fast integer arithmetic
- From: "Leo Razoumov" <slonik.az@...>
- Date: Wed, 20 Feb 2008 10:50:43 -0500
On 20 Feb 2008 08:19:05 -0500, John D. Ramsdell <email@example.com> 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.