This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Micro optimize bitmap_clear_bit
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, gcc-patches at gcc dot gnu dot org, rguenther at suse dot de
- Date: Tue, 22 Jun 2010 15:27:19 +0200
- Subject: Re: Micro optimize bitmap_clear_bit
- References: <20100622123003.GB15547@kam.mff.cuni.cz> <4C20B1DE.4080307@oracle.com>
> On 06/22/2010 02:30 PM, Jan Hubicka wrote:
> > The patch seems to save about 10% of samples on bitmap_clear_bit, but it is
> > within noise factor.
> >
> To be frank, I don't understand this stance. As I see this type of
> issue, either you have independent reasons to believe that the patch is
> beneficial and just go ahead, or you should repeat the test enough times
> and in the correct conditions until you reach statistical significance.
> Otherwise, I don't believe it really makes sense to mention numbers
> which you don't trust yourself...
Well, I can dig bit deeper.
In this case I oprofiled cc1 binary before the change 8 times, and the numbers
of samples was always above 10000 for bitmap_clear_bit (removing the peaks and
averaging, it is 11480), results are +-2000 samples including the peaks. After
the change, I profiled 4 times, the average is 9988. So the 10% difference is
pretty clear.
However with this particular patch, it seemed just good idea to microoptimize
the conditional even if the overall effects on compile time are very tiny.
(bitmap_clear_bit is 0.9% of compile time in my benchmark, so the overall change
should be about 0.09%)
Honza
>
> Paolo.