This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: poor performance -- is Cygwin to blame?..


----- Original Message -----
From: "Mikhail Teterin" <mi@corbulon.video-collage.com>
To: "Timothy C Prince" <tprince@myrealbox.com>
Cc: <cygwin@cygwin.com>
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.

Attachment: mathinline.h
Description: Binary data

--
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/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]