Subject: Re: poor performance -- is Cygwin to blame?..
From: "tprinceusa" <[email-masked]>
To: "Mikhail Teterin" <[email-masked]>
Cc: <[email-masked]>
Date: Sat, 21 Dec 2002 10:22:20 -0800

----- Original Message -----
From: "Mikhail Teterin" <[email-masked]>
To: "Timothy C Prince" <[email-masked]>
Cc: <[email-masked]>
Sent: Saturday, December 21, 2002 6:47 AM
Subject: Re: poor performance -- is Cygwin to blame?..

> > In my experience with MPI programs, comparing cygwin and linux,
> > message passing takes longer under cygwin, but the time may be made up
> > elsewhere, if the compilation is truly similar.
> >
> > You mention that considerable time is spent in log(), pow(), exp()
> > but leave us guessing how you implemented them.
>
> I did not implement them. They are from whatever -lm means on Cygwin. I
> use them to compute my own formula repeatedly for hundreds of different
> vectors.
>
> > Then you imply that you think cygwin, rather than your math functions,
> > is the speed determining factor, without giving us a means to judge.
>
> They are not mine. There must be a misunderstanding...
>
> > The glibc versions of these functions are much faster than the newlib
> > versions, particularly if you permit the use of <mathinline.h>.
> > Neither approach the potential of pentium4, but the simplest way to
> > speed them up on cygwin is to employ something like <mathinline.h>,
> > and to provide your own pow() (or to use a compiler and library which
> > targets pentium4).
>
> Can this be done with just CFLAGS? I really don't want to pollute my
> code with ``#ifdef CYGWIN''... Thank you,
>
You could simply add
#include <mathinline.h>
just ahead of the final #endif in whichever <math.h> file is active, and supply a mathinline.h (example attached) in the include
search path.  You could add guards so that the <mathinline.h> is invoked in accordance with command line flags.  See the glibc
example for which in-line functions are made to depend on -ffast-math.  I have corrected some extreme value cases in my version, so
that it may not be as risky as the full glibc -ffast-math version.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/