|
From: Development l. f. F. <fas...@li...> - 2007-04-17 17:57:08
|
I just had a look at your code and one big performance
hit is the lack of static inline functions.
Every function which does not need to be accessed
outside the module should be static. Probably the
compiler does this automatically where possible, but
in your case your test code probably wants to access
it, making static impossible. The difference is the
overhead in function calls. Functions which can be
made static have less overhead.
The way to get around this is to introduce wrapper
functions for your static functions. The wrapper
functions can be called by your test code and they in
turn will call your static functions. Obviously other
functions in the same module will not call the wrapper
functions, but call the functions directly, since they
are in the same file.
Everything that is short (say less than 10 lines)
should be static inlined. This is apparently
particularly important on the G5.
Bill.
--- Development list for FLINT
<fas...@li...> wrote:
>
> --- Development list for FLINT
> <fas...@li...> wrote:
>
> >
> > On Apr 17, 2007, at 1:26 PM, Development list for
> > FLINT wrote:
> >
> > > Are you compiling with all the G5 compiler
> > options:
> > >
> > > -mcpu=970 -mtune=970 -mpowerpc64
> >
> > No. I've been using
> >
> > -m64 -funroll-loops -fexpensive-optimizations -O3
>
> You should still use -funroll-loops and -O3
>
> >
> > I will try your suggestion tonight at home.
> >
> > > Also, what version of gcc do you have on your
> G5?
> >
> > Can't recall; I'll find out tonight.
> >
> > > Apparently at the Apple developer site you can
> > > download a version specially tuned for the G5.
> > Dunno
> > > if it is better than just the latest gcc from
> the
> > web
> > > though. Never used a MAC.
> >
> > I believe I'm using the gcc that came installed,
> so
> > it should already
> > be the apple version.
>
> Apparently it is not. According to the apple
> developer
> website, the one that comes with it is not the
> specially tuned one.
>
> >
> > Keep in mind, I'm using the same compiler settings
> > for profiling the
> > old ssfft code too.
>
> Apparently the G5 also likes you to access data as
> soon as possible before it is "used" (whatever that
> means). It likes data to be accessed sequentially in
> order and data that can be accessed outside a loop
> instead of inside the loop will speed things up. I
> think what this means is to have a variable which
> you
> load with the data from memory, then do the loop
> acting on the data from the variable rather than
> loading it from memory every time the loop executes.
>
> You should not use type conversions unless you
> absolutely need to, nor global variables (though I
> am
> sure you don't have any of those). Also the G5 is
> particularly susceptible to slowdowns from branch
> mispredictions. It is much better to do:
>
> do B;
> if (cond)
> {
> undo B;
> do A;
> }
>
> than to do:
>
> if (cond)
> {
> do A;
> } else
> {
> do B;
> }
>
> if B should be done most of the time.
>
> Apart from these things, I can't see any sensible
> guidelines for developing on the G5.
>
> The Apple website says that Apple has written
> special
> code for doing FFT's on the G5 because many
> developers
> have handwritten code for the G5 and been sorely
> disappointed that it runs way slower on the G5. I
> think there are quite a lot of assembly
> optimizations
> for the G5 not employed by gcc according to the
> documentation.
>
> Bill.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2
> express and take
> control of your XML. No limits. Just data. Click to
> get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Fastlibnt-devel mailing list
> Fas...@li...
>
https://lists.sourceforge.net/lists/listinfo/fastlibnt-devel
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
|