You are not logged in.

#1 2009-09-04 02:49:11

davidoff
Member
Registered: 2008-06-10
Posts: 23

R (cran) twice as fast on Windows than Arch 64??

Arguably an R rather than Arch question I realize but:
my colleague and I both have brand new Lenovo ThinkCentres.  Same specs but he has more RAM (I don't think that's the issue).  We run the same program

length <- 2*10^6
a <- runif(length)
b <- runif(length)
print(summary(lm(a~b)))

I take 16 seconds in Arch 64, but never bump against a memory constraint (looks like about 1/3 of RAM used max).
My colleague, with Windows, takes 7 seconds.
The R documentation says 32 bit R is about 10% faster in some cases, but that doesn't explain a 50% difference.
I *think* I have compiled 32 bit R on my system and it doesn't seem to go any faster.

By contrast I run a python loop a bit faster than my colleague.

Thoughts?

Last edited by davidoff (2009-09-04 02:50:14)

Offline

#2 2009-09-04 03:01:05

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,487
Website

Re: R (cran) twice as fast on Windows than Arch 64??

That is a bit strange and not something I have ever noticed.  Does it take the same time on the second attempt?

Try comparing the time when running it from the command line:

R CMD BATCH file

where file has the R code.

Online

#3 2009-09-04 04:40:39

davidoff
Member
Registered: 2008-06-10
Posts: 23

Re: R (cran) twice as fast on Windows than Arch 64??

Same time (roughly) every time, and I run from the command line (R CMD BATCH).  Routine takes about the same time run at R prompt.
And this is true whether I compile R from cran's sources or from pacman.

Offline

#4 2009-09-04 06:06:52

iBertus
Member
From: Greenville, NC
Registered: 2004-11-04
Posts: 2,228

Re: R (cran) twice as fast on Windows than Arch 64??

How was the version being run on Windows built? Could it be more optimized than the version in the Arch repos?

Offline

#5 2009-09-04 21:20:55

davidoff
Member
Registered: 2008-06-10
Posts: 23

Re: R (cran) twice as fast on Windows than Arch 64??

No optimization on either OS, just straight out of the box.  I get the same results with all of: R from cran 64 or 32 bit build, R from pacman.  The windows was just a straight download of the 32 bit for windows from cran.

Offline

#6 2009-09-05 01:02:23

iBertus
Member
From: Greenville, NC
Registered: 2004-11-04
Posts: 2,228

Re: R (cran) twice as fast on Windows than Arch 64??

It is possible that if the 32-bit R from CRAN was compiled with MSVC++ instead of GCC that it did a better job of optimizing the code. GCC isn't always the best in this area.

Offline

#7 2009-09-05 01:13:39

jt512
Member
Registered: 2009-02-19
Posts: 262

Re: R (cran) twice as fast on Windows than Arch 64??

davidoff wrote:

Arguably an R rather than Arch question I realize but:
my colleague and I both have brand new Lenovo ThinkCentres.  Same specs but he has more RAM (I don't think that's the issue).  We run the same program

length <- 2*10^6
a <- runif(length)
b <- runif(length)
print(summary(lm(a~b)))

I take 16 seconds in Arch 64, but never bump against a memory constraint (looks like about 1/3 of RAM used max).
My colleague, with Windows, takes 7 seconds.
The R documentation says 32 bit R is about 10% faster in some cases, but that doesn't explain a 50% difference.
I *think* I have compiled 32 bit R on my system and it doesn't seem to go any faster.

By contrast I run a python loop a bit faster than my colleague.

Thoughts?

If I run that on my Arch64 box, it takes 23 sec.  If I run it a second time it takes 6 sec.

Jay

Offline

Board footer

Powered by FluxBB