lua-users home
lua-l archive

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


On 2 November 2011 20:59, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> I commented it out just so I could run the speed test. WOW
>>
>> https://gist.github.com/1334864
>
> 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
operators"

> 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 :)

Liam