lua-users home
lua-l archive

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


Mike Pall wrote:

I don't believe that GCC is that much better than either Watcom C
or whatever Ignacio used to compile Lua. Have both of you compiled
with full optimization and in release mode? And without Lua API
assertions? IMHO there should be a maximum factor of 2x-3x between
our timings.

Nope, I compiled with MSVC 6 and /MD /O2 flags. But I do have API assertions enabled.

The previous benchmark I sent I was mistakingly running on power saving mode on my laptop.

Now it is on max. performance mode and the benchmark gives:
lua5.1 -lluarocks.require d:\Lua\LuaBitOp-1.0.0\bitbench.lua

loop baseline     41.5 ns
tobit            128.5 ns
bnot             149.9 ns
bor/band/bxor    185.0 ns
shifts           183.1 ns
rotates          177.3 ns
bswap            140.1 ns

Still not as quick as yours, but remember that I have API assertions so I'm not a good reference.


Ignacio Burgueño wrote:
However, the following does not act as expected:

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

Nope, that's the expected output. The argument is exponential, see
the description in doc/install.html. And 'arg' is used to get the
Lua command line arguments, not a vararg function argument.

Oh... My mistake. Sorry for the noise.

Regards,
Ignacio