[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaJIT with vectors
- From: David Kastrup <dak@...>
- Date: Thu, 18 Nov 2010 14:35:15 +0100
Alex Queiroz <asandroq@gmail.com> writes:
> On Thu, Nov 18, 2010 at 11:24 AM, Nilson <nilson.brazil@gmail.com> wrote:
>>
>> I had the same impression, but analyzing the resulted assembly code I
>> realized that the performance of switch depends on the compiler that
>> you use. Lua's team always defines the values used by the switch
>> statements in a minimal range (excellent design). So the compiler can
>> create a Table Of Address to jump to the case option.
>>
>
> Ah, very interesting! I didn't know that, thank you.
I may be dull, but I don't see what about that code would not disturb
branch prediction and pipelining.
While it may coincide with the implementation I'd personally use in
assembly language for a VM, the cited reasons for lambasting other
"switch" implementations don't appear all too valid.
--
David Kastrup