List:Commits« Previous MessageNext Message »
From:Roy Lyseng Date:March 31 2011 8:39pm
Subject:Re: bzr commit into mysql-trunk branch (jorgen.loland:3323) Bug#11766327
View as plain text  
Hi Guilhem,

On 31.03.11 21.49, Guilhem Bichot wrote:

>>>> +bool JOIN_TAB::extend_and_fix_jt_and_sel_cond(Item *add_cond, uint
> line)
>>>> +{
>>>> + if (extend_and_fix_cond(add_cond, line))
>>>
>>> could add unlikely()
>>
>> I'm a bit afraid of the "code contamination" of these unlikely() macros.
>
> Well... we have those macros... I find it's good if it can help lower the
> performance impact of all those rarely executed "if (out of memory)".
> What bad do they do?
>
>> There is also an option to gather branch prediction statistics using two-stage
>> compilations. (The first stage gathers statistics, the second uses statistics
>> to apply branch prediction hints). The benefit of this is that code need no
>> changes, the drawback is the need for two-stage compilation, which makes it
>> hard to do in developer sandboxes.
>
> I'm not aware of two-stage compilation. What compiler does that?
> And, isn't it dangerous? I mean, OOM happens rarely on the Lab machine where the
> release is built, as rarely as on the customer's, so if(OOM) will be optimized
> the same way, but for the other if()s, they may be optimized in some way on the
> Lab machine, in a way which isn't representative of a real load, and thus would
> perform poorly at the customer's??

We did that for Clustra/HADB on Solaris using SunStudio compilers several years 
ago. The speedup was amazing, probably 10-15%. Nowadays, I think gcc is capable 
of this as well.

I think the way it works is that regardless of load, most if tests have a branch 
that is taken more often than others. And if there is an occational miss, the 
result is barely noticeable.

Thanks,
Roy
Thread
bzr commit into mysql-trunk branch (jorgen.loland:3323) Bug#11766327Jorgen Loland25 Mar
  • Re: bzr commit into mysql-trunk branch (jorgen.loland:3323) Bug#11766327Guilhem Bichot31 Mar
    • Re: bzr commit into mysql-trunk branch (jorgen.loland:3323) Bug#11766327Roy Lyseng31 Mar
      • Re: bzr commit into mysql-trunk branch (jorgen.loland:3323) Bug#11766327Guilhem Bichot31 Mar
        • Re: bzr commit into mysql-trunk branch (jorgen.loland:3323) Bug#11766327Roy Lyseng31 Mar