[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: native code for bitwise operators in LUA
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 2 Nov 2011 18:59:51 -0200
> I commented it out just so I could run the speed test. WOW
The speed difference you see is expected, of course.
Surely any operation can be made faster by providing a VM instruction
for it. The hard decision is what to include, which reminds me of
something I heard about I think it was Word: no one uses more than 5%
of Word, by each person uses a different 5%, hence the bloat.
If you find yourself writing bit-intensive programs in Lua, perhaps
a dedicated C function is recommended. I understand that not all Lua
environments can load C libraries (WoW comes to mind); the bit32 library
is meant to make bit manipulation possible in Lua, not to make it fast.