[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaJIT with vectors
- From: Alex Queiroz <asandroq@...>
- Date: Thu, 18 Nov 2010 11:26:39 -0200
On Thu, Nov 18, 2010 at 11:17 AM, David Kastrup <dak@gnu.org> wrote:
> Alex Queiroz <asandroq@gmail.com> writes:
>>
>> Sometimes I wonder how plain Lua can be so fast sticking only to
>> standard ANSI C. That's an achievement. For instance, the VM dispatch
>> uses the C switch statement, which is known to be slow.
>
> Huh? Why would it be "known to be slow"? Have you taken a look at the
> kind of code it generates?
>
The standards-compliant switch statement must emit code to check
interval range. This code kills the CPU predictor and causes severe
pipeline flushing.
--
-alex
http://www.artisancoder.com/