Re: GCC is 7 times slower than Intel? How to optimize? Need help!!

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

 



On Tue, Oct 07, 2008 at 08:58:16AM -0400, John Fine wrote:
> Andrew Haley wrote:
> >jackfrost wrote:
> >  
> >>Ian Lance Taylor-3 wrote:
> >>    
> >>>Try -ffast-math.  I think it's the default for icc when optimizing.
> >>>      
> >>I've tried  -ffast-math with the same result.
> >>    
> >
> >You're going to have to look at the generated assembler code.
> >
> >  
> 
> The generated assembler code wouldn't tell you anything.
> 
> Almost all the CPU time is spent inside the exp() function.  I'm 
> confident neither gcc nor Intel10 is inlining the exp() function, so you 
> won't see the implementation of exp() in that generated assembler code.
> 
> You can look at the source code for the gnu version of exp().  Maybe you 
> can even figure out the conditions under which it is slow.
> 
> What are you trying to accomplish with the investigation of this 
> performance issue?  Does the program whose performance you really care 
> about heavily use exp()?  (Or did you get sidetracked into an exp() 
> investigation when you really care about something else?)  Do you need 
> to use the gnu version of exp()?  For an open source project, I guess 
> you would.  For a program you will just use yourself, it is practical to 
> use Intel's version of exp() (and similar functions in libimf) even when 
> compiling your own source code with gcc.

IIRC, one of the spec 2006 suite is heavily dominated by calls to exp.  So
programs do exist that are dominated by the 'exp' function.

Note if you are doing benchmarking, it can be helpful to do your profiling on a
program with a profiled static libm, so that you can see how much time is being
spent in exp compared to other parts of the code.

-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@xxxxxxxxxxxxxxxxxx

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux