lua-users home
lua-l archive

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


On Sun, Jan 22, 2012 at 2:26 AM, Francesco Abbate
<francesco.bbt@gmail.com> wrote:
> Actually if the math.random is used the algorithm is faster that C but
> we didn't clearly understand the reason.

So this is the performance bottleneck; LuaJIT's math.random is an
optimized fast call.  So the Lua/C boundary is penalizing your other
random generator.

Just a thought: how about coding the random number generator directly in Lua?

steve d.