Philippe Grosjean
2003-Aug-04 14:07 UTC
[R] ^ operation much slower in R 1.7.1 than in R 1.7.0 ???
I do not understand what happens here (under Win XP): a <- abs(matrix(rnorm(800*800)/2, ncol=800, nrow=800)) system.time(b <- a^1000)[3] took about 1 sec on my computer with R 1.7.0 and it takes now 4.59 sec with R 1.7.1 Similarly, phi <- 1.6180339887498949 a <- floor(runif(750000)*1000) system.time(b <- (phi^a - (-phi)^(-a))/sqrt(5))[3] took about 0.9 sec with R 1.7.0, and it takes 11.8 sec (!!!) in R 1.7.1. Are there some changes made between 1.7.0 and 1.7.1 that could cause such a large difference in time to do such simple computations??? Best, Philippe Grosjean ...........]<(({?<...............<?}))><............................... ) ) ) ) ) ( ( ( ( ( Dr. Philippe Grosjean ) ) ) ) ) ( ( ( ( ( LOV, UMR 7093 ) ) ) ) ) Station Zoologique ( ( ( ( ( Observatoire Oc?anologique ) ) ) ) ) BP 28 ( ( ( ( ( 06234 Villefranche sur mer cedex ) ) ) ) ) France ( ( ( ( ( ) ) ) ) ) tel: +33.4.93.76.38.18, fax: +33.4.93.76.38.34 ( ( ( ( ( ) ) ) ) ) e-mail: phgrosjean at sciviews.org ( ( ( ( ( SciViews project coordinator (http://www.sciviews.org) ) ) ) ) ) .......................................................................
Peter Dalgaard BSA
2003-Aug-04 15:25 UTC
[R] ^ operation much slower in R 1.7.1 than in R 1.7.0 ???
"Philippe Grosjean" <phgrosjean at sciviews.org> writes:> I do not understand what happens here (under Win XP): > > a <- abs(matrix(rnorm(800*800)/2, ncol=800, nrow=800)) > system.time(b <- a^1000)[3] > > took about 1 sec on my computer with R 1.7.0 and it takes now 4.59 sec with > R 1.7.1 > > Similarly, > > phi <- 1.6180339887498949 > a <- floor(runif(750000)*1000) > system.time(b <- (phi^a - (-phi)^(-a))/sqrt(5))[3] > > took about 0.9 sec with R 1.7.0, and it takes 11.8 sec (!!!) in R 1.7.1. > > Are there some changes made between 1.7.0 and 1.7.1 that could cause such a > large difference in time to do such simple computations???Hmm, on linux, I get approx 0.31 for the first example with 1.7.0, 1.7.1, r-patched, and r-devel. Similarly, I get 0.8 for the second ex. in all four cases. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
James MacDonald
2003-Aug-04 15:46 UTC
[R] ^ operation much slower in R 1.7.1 than in R 1.7.0 ???
I get similar results as Philippe on WinXP (1.33 GHz laptop, 512 Mb RAM). R 1.7.1 2.86 sec 7.82 sec R 1.7.0 0.64 sec 1.64 sec Jim James W. MacDonald Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623>>> Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk> 08/04/03 11:30AM >>>"Philippe Grosjean" <phgrosjean at sciviews.org> writes:> I do not understand what happens here (under Win XP): > > a <- abs(matrix(rnorm(800*800)/2, ncol=800, nrow=800)) > system.time(b <- a^1000)[3] > > took about 1 sec on my computer with R 1.7.0 and it takes now 4.59sec with> R 1.7.1 > > Similarly, > > phi <- 1.6180339887498949 > a <- floor(runif(750000)*1000) > system.time(b <- (phi^a - (-phi)^(-a))/sqrt(5))[3] > > took about 0.9 sec with R 1.7.0, and it takes 11.8 sec (!!!) in R1.7.1.> > Are there some changes made between 1.7.0 and 1.7.1 that could causesuch a> large difference in time to do such simple computations???Hmm, on linux, I get approx 0.31 for the first example with 1.7.0, 1.7.1, r-patched, and r-devel. Similarly, I get 0.8 for the second ex. in all four cases. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Thomas Lumley
2003-Aug-04 16:28 UTC
[R] ^ operation much slower in R 1.7.1 than in R 1.7.0 ???
On 4 Aug 2003, Peter Dalgaard BSA wrote:> > Hmm, on linux, I get approx 0.31 for the first example with 1.7.0, > 1.7.1, r-patched, and r-devel. Similarly, I get 0.8 for the second ex. > in all four cases. >I also find a slowdown under Win2K. Was there a compiler version change with the Windows binary, perhaps? -thomas Thomas Lumley Assoc. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle
Charles Annis, P.E.
2003-Aug-04 17:22 UTC
[R] ^ operation much slower in R 1.7.1 than in R 1.7.0 ???
Nearly 5X slower on DELL Pentium 4, 2.26GHz, 1Gig, WinXP-Pro .......... R : Copyright 2003, The R Development Core Team Version 1.7.0 (2003-04-16)> a <- abs(matrix(rnorm(800*800)/2, ncol=800, nrow=800)) > system.time(b <- a^1000)[3][1] 0.68>.......... R : Copyright 2003, The R Development Core Team Version 1.7.1 (2003-06-16)> a <- abs(matrix(rnorm(800*800)/2, ncol=800, nrow=800)) > system.time(b <- a^1000)[3][1] 3.29>Charles Annis, P.E. Charles.Annis at StatisticalEngineering.com phone: 561-352-9699 eFAX: 503-217-5849 http://www.StatisticalEngineering.com
Patrick Connolly
2003-Aug-05 03:19 UTC
[R] ^ operation much slower in R 1.7.1 than in R 1.7.0 ???
On Mon, 04-Aug-2003 at 09:28AM -0700, Thomas Lumley wrote: |> On 4 Aug 2003, Peter Dalgaard BSA wrote: |> |> > |> > Hmm, on linux, I get approx 0.31 for the first example with 1.7.0, |> > 1.7.1, r-patched, and r-devel. Similarly, I get 0.8 for the second ex. |> > in all four cases. |> > |> |> I also find a slowdown under Win2K. Was there a compiler version change |> with the Windows binary, perhaps? In case anyone is interested..... version _ platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major 1 minor 7.1 year 2003 month 06 day 16 language R 0.54 and 1.24 platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major 1 minor 7.0 year 2003 month 04 day 16 language R 0.55 and 1.13 Both are compiled using the maligned gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113) HTH -- Patrick Connolly HortResearch Mt Albert Auckland New Zealand Ph: +64-9 815 4200 x 7188 ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~ I have the world`s largest collection of seashells. I keep it on all the beaches of the world ... Perhaps you`ve seen it. ---Steven Wright ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~
Philippe Grosjean
2003-Aug-05 12:31 UTC
[Rd] RE: [R] ^ operation much slower in R 1.7.1 than in R 1.7.0 ???
OK. Now I have compiled R 1.7.1 myself on my Windows XP pro computer with the recommended tools and MingW 2.0.0-3. Here is what I got: a <- abs(matrix(rnorm(800*800)/2, ncol=800, nrow=800)) system.time(b <- a^1000)[3] R 1.7.0 : 1.00 sec R 1.7.1 (from CRAN): 4.59 sec R 1.7.1 (custom) : 0.99 sec phi <- 1.6180339887498949 a <- floor(runif(750000)*1000) system.time(b <- (phi^a - (-phi)^(-a))/sqrt(5))[3] R 1.7.0 : 0.90 sec R 1.7.1 (from CRAN): 11.80 sec R 1.7.1 (custom) : 1.08 sec It seems thus that the problem originates in the Windows compilation of the CRAN version of R 1.7.1. We will wait Duncan Murdoch for some more explanation. I cannot place the custom rw1071.exe on my web site because it is too large (almost 22 Mb). For the moment, you should recompile from source by yourself to get top speed in R 1.7.1. Best, Philippe Grosjean ...........]<(({?<...............<?}))><............................... ) ) ) ) ) ( ( ( ( ( Dr. Philippe Grosjean ) ) ) ) ) ( ( ( ( ( LOV, UMR 7093 ) ) ) ) ) Station Zoologique ( ( ( ( ( Observatoire Oc?anologique ) ) ) ) ) BP 28 ( ( ( ( ( 06234 Villefranche sur mer cedex ) ) ) ) ) France ( ( ( ( ( ) ) ) ) ) tel: +33.4.93.76.38.18, fax: +33.4.93.76.38.34 ( ( ( ( ( ) ) ) ) ) e-mail: phgrosjean@sciviews.org ( ( ( ( ( SciViews project coordinator (http://www.sciviews.org) ) ) ) ) ) .......................................................................
Prof Brian Ripley
2003-Aug-05 13:07 UTC
[Rd] RE: [R] ^ operation much slower in R 1.7.1 than in R 1.7.0 ???
On Tue, 5 Aug 2003, Philippe Grosjean wrote:> OK. Now I have compiled R 1.7.1 myself on my Windows XP pro computer with > the recommended tools and MingW 2.0.0-3. > Here is what I got: > > a <- abs(matrix(rnorm(800*800)/2, ncol=800, nrow=800)) > system.time(b <- a^1000)[3] > > R 1.7.0 : 1.00 sec > R 1.7.1 (from CRAN): 4.59 sec > R 1.7.1 (custom) : 0.99 sec > > phi <- 1.6180339887498949 > a <- floor(runif(750000)*1000) > system.time(b <- (phi^a - (-phi)^(-a))/sqrt(5))[3] > > R 1.7.0 : 0.90 sec > R 1.7.1 (from CRAN): 11.80 sec > R 1.7.1 (custom) : 1.08 sec > > It seems thus that the problem originates in the Windows compilation of theFor whom is this a `problem'? A lot more than 10 secs has been spent on this thread.> CRAN version of R 1.7.1. We will wait Duncan Murdoch for some more > explanation. I cannot place the custom rw1071.exe on my web site because it > is too large (almost 22 Mb). For the moment, you should recompile from > source by yourself to get top speed in R 1.7.1.*On this one operation*: we don't know that others may be faster or more accurate on the CRAN version, nor how different chips compare. You too have not told us exactly what setup you used, and FWIW when I compile 1.7.0 myself I get the slow speed (using MinGW 3.0.0 rc3). I suspect the difference is due to the use of a later version of mingw-runtime, and that the later routines are slower but more accurate. (Looks like mingw-runtime-2.2 used pow from msvcrt.dll, and -2.4/-3.0 have their own: 2002-10-07 Danny Smith <dannysmith@users.sourceforge.net> * mingwex/math/pow.c: New file. He presumably had good reasons for doing that.) Your conclusion seems unsubstantiated by your evidence. Something like `if you are using Windows and ^ dominates the timings of your code, you may want to try re-compiling using mingw-runtime-2.2' seems the only valid conclusion. -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595