lua-users home
lua-l archive

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


Mike Pall wrote:
Lua BitOp is a C extension module for Lua 5.1 which adds
bitwise operations on numbers.


Thanks, Mike.

Running on WinXP SP3, Lua 5.1.4 [1] with bit.dll packaged as a rock:

lua5.1 -lluarocks.require d:\Lua\LuaBitOp-1.0.0\bitbench.lua

loop baseline     72.3 ns
tobit            240.3 ns
bnot             248.0 ns
bor/band/bxor    345.8 ns
shifts           420.0 ns
rotates          318.3 ns
bswap            244.3 ns


However, the following does not act as expected:
lua5.1 -lluarocks.require d:\Lua\LuaBitOp-1.0.0\nsievebits.lua 9

Primes up to  5120000   356244
Primes up to  2560000   187134
Primes up to  1280000    98610


Surely it's because nsievebits.lua uses 'arg' and my build of Lua has LUA_COMPAT_VARARG disabled.

Regards,
Ignacio



[1] My laptop specs are:
Intel CoreDuo 1.66 GHz, 667 MHz FSB, 2MB L2 cache
2 GB RAM