dotgnu-libjit
[Top][All Lists]
Advanced

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

[Dotgnu-libjit] performance of conditionals


From: Kirill Kononenko
Subject: [Dotgnu-libjit] performance of conditionals
Date: Thu, 23 Apr 2009 12:15:11 +0400

Hi Paul


I find your project Ludicrous JIT a really cool project.

I hope my project can help you. It should give even a better bust of
speed. It enables more optimization with
jit_function_set_optimization_level, from [0 to 4].

Please let me know if there is something I can implement for your
project in libJIT. Anything is acceptable.


Thanks,
Kirill

--
http://code.google.com/p/libjit-linear-scan-register-allocator/

2008/11/12 Kirill Kononenko <address@hidden>:
> Hello
>
>
> There are two things to consider:
>
> 1. You should assume that a conditional branch is taken in 90% of cases.
> 2. And a simplied CPU will predict the same branch target, which was
> taken the previous time.
>
>
> Thanks,
> Kirill
>
>
> 2008/11/10 Paul Brannan <address@hidden>:
>> I have a conditional in which one case is many more times likely to
>> occur than the other case.  Currently the implementation does this:
>>
>>      branch_if_not(cond, L1)
>>      <true case>
>>      branch(L2)
>>  L1: <false case>
>>  L2: <remainder of code>
>>      ...
>>      return
>>
>> I have considered implementing it like this instead:
>>
>>      branch_if_not(cond, L1)
>>      <true case>
>>  L2: <remainder of code>
>>      ...
>>      return
>>  L1: <false case>
>>      branch(L2)
>>
>> thus avoiding the branch for the usual case.
>>
>> I'm not a low-level guru, so I'm curious how in general this sort of
>> refactoring affects performance.
>>
>> I would write a benchmark, but I'm not sure how to write it in such a
>> way that it would necessarily reflect real-world performance.
>>
>> Thoughts?
>>
>> Paul
>>
>>
>>
>> _______________________________________________
>> Dotgnu-libjit mailing list
>> address@hidden
>> http://lists.gnu.org/mailman/listinfo/dotgnu-libjit
>>
>



--
http://code.google.com/p/libjit-linear-scan-register-allocator/



-- 
http://code.google.com/p/libjit-linear-scan-register-allocator/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]