From p.dalgaard at biostat.ku.dk  Tue Aug  5 16:10:00 2003
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard BSA)
Date: Tue Aug  5 17:10:02 2003
Subject: [Rd] RE: [R] ^ operation much slower in R 1.7.1 than in R 1.7.0
	???
In-Reply-To: <Pine.A41.4.44.0308050718200.240674-100000@homer01.u.washington.edu>
References: <Pine.A41.4.44.0308050718200.240674-100000@homer01.u.washington.edu>
Message-ID: <x2smog2kzo.fsf@biostat.ku.dk>

Thomas Lumley <tlumley@u.washington.edu> writes:

> On Tue, 5 Aug 2003, Philippe Grosjean wrote:
> >
> > OK. But I was wondering if people at R-core team, especially those who
> > worked on Windows specific aspects, would have in mind some changes they did
> > between 1.7.0 and 1.7.1 than can cause this. Since these changes are mainly
> > corrections of bugs, the list is hopefully not so long... and it could help
> > a lot to have these hints. Thanks very much.
> 
> I checked that the slowdown really was happening in "^", which is
> Primitive and so fairly direct.  I couldn't find anything remotely
> plausible as a cause, though.
> 
> My first guess was something involving the methods package and my second
> was a compiler change, so I'm 0-2 so far.

I think we can be fairly sure that the reason is that a new pow()
function was injected in the mingw runtime. You can find the actual
code in

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mingw/runtime/mingwex/math/

*why* this code was inserted is anyones guess. Googling threw up some
 hint that the MS-supplied pow() was upsetting strtod and causing a
 regression test failure with the Gimp. The code looks considerably
 different from the kind of stuff used on Linux though, e.g. it
 appears not to use FPU transcendentals. I suppose one could ask the
 author...

Also, R is generally compiled with -D NO_MATH_INLINES because of some
ancient messup with glibc. I'm not sure whether that is actually still
necessary, but it is forcing the use of the non-inlined pow() function.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] RE: [R] ^ operation much slower in R 1.7.1 than in R 1.7.0 ???
Peter Dalgaard BSA