[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: native code for bitwise operators in LUA
- From: liam mail <liam.list@...>
- Date: Wed, 2 Nov 2011 21:21:47 +0000
On 2 November 2011 20:59, Luiz Henrique de Figueiredo
>> 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.
Yes of course a speed up was expected but it is much more than the
advertised "approximately 5x faster native versus bit32.bxxx
> 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.
I can sort of understand that philosophy yet bit operations are meant
to be fast, although I can maybe understand why these operators were
not used and also why they are not vm op codes. Having said that it
would be nice to have them like so in a Rio release but then everybody
wants everything in a Rio release :)