lua-users home
lua-l archive

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


On Fri, Apr 11, 2014 at 9:05 PM, Peng Zhicheng
<pengzhicheng1986@gmail.com> wrote:
> and, actually I am not very confident about the performance, since it shifts
> bits
> and multiply (by default 64-bit) integers; would that be faster than the
> FPU? how much faster?

Depends on the platform, depends on the C library, depends on the
optimization level. Exponentiation is expensive in general, but
integer multiplies are faster than float multiplies in general. That
said, the overhead of Lua being an interpreter is probably going to be
more significant than the performance difference, and I am of the
opinion that the value of correctness is significant.

/s/ Adam