My adviser has a Mac notebook that he bought 6 months ago, and I have a
PC notebook I bought a month ago. Here are the respective specs, as far as I know them: His: Mac OSX 1 GB DDR2 RAM Intel Core Duo, 2 GHz (2MB cache per core) Unknown HD Mine Windows Vista Home Premium 32bit 2 GB DDR2 RAM Intel Core 2 Duo, 2 GHz (4MB cache) 5400 RPM Hard Drive We are both running R. As a test to see whose laptop was faster, we decided to invert large random matrices. In R language, it looks like this: N=2000 A=rnorm(N^2) A=matrix(A,ncol=N) solve(A) This creates a matrix of 4,000,000 random normal deviates and inverts it. His computer takes about 7 seconds, while mine takes about 14. Why the difference? I have several working hypotheses, and it would be interesting to see what you guys think. 1. R on Mac was compiled with optimizations for the CPU, with R for Windows was not. I could test this by compiling R with the Intel compiler, or GCC with optimizations, and seeing if I get a significant speed boost. 2. His R is 64 bit, while mine is for 32 bit windows. (I'm not sure how much of a diference that makes, or whether OSX is 64 bit.) 3. Data is getting swapped to the hard drive, and my hard drive is slower than his. I chose a slower hard drive to get bigger capacity for the price. This is not intended to be an OMG MACOS = TEH R0X0R thread. I'm just trying to explain the discrepency. Thanks! ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
Such a calculation would be dominated by the time spent inside a call
to an offf-the-shelf C matrix inversion library used by R and is not really any test of R itself. On 3/9/07, Richard Morey <[hidden email]> wrote: > My adviser has a Mac notebook that he bought 6 months ago, and I have a > PC notebook I bought a month ago. Here are the respective specs, as far > as I know them: > > His: > Mac OSX > 1 GB DDR2 RAM > Intel Core Duo, 2 GHz (2MB cache per core) > Unknown HD > > Mine > Windows Vista Home Premium 32bit > 2 GB DDR2 RAM > Intel Core 2 Duo, 2 GHz (4MB cache) > 5400 RPM Hard Drive > > > We are both running R. As a test to see whose laptop was faster, we > decided to invert large random matrices. In R language, it looks like this: > > N=2000 > A=rnorm(N^2) > A=matrix(A,ncol=N) > solve(A) > > This creates a matrix of 4,000,000 random normal deviates and inverts > it. His computer takes about 7 seconds, while mine takes about 14. Why > the difference? I have several working hypotheses, and it would be > interesting to see what you guys think. > > 1. R on Mac was compiled with optimizations for the CPU, with R for > Windows was not. I could test this by compiling R with the Intel > compiler, or GCC with optimizations, and seeing if I get a significant > speed boost. > > 2. His R is 64 bit, while mine is for 32 bit windows. (I'm not sure how > much of a diference that makes, or whether OSX is 64 bit.) > > 3. Data is getting swapped to the hard drive, and my hard drive is > slower than his. I chose a slower hard drive to get bigger capacity for > the price. > > This is not intended to be an OMG MACOS = TEH R0X0R thread. I'm just > trying to explain the discrepency. > > Thanks! > > ______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
In reply to this post by richarddmorey
On Fri, 9 Mar 2007, Richard Morey wrote:
> 1. R on Mac was compiled with optimizations for the CPU, with R for > Windows was not. I could test this by compiling R with the Intel > compiler, or GCC with optimizations, and seeing if I get a significant > speed boost. Yes. The Mac distribution uses Apple's linear algebra library, which is based on ATLAS and uses both cores. The default Windows distribution doesn't use an optimized linear algebra library because there isn't one built in to Windows. You can use ATLAS with the Windows distribution and there are even precompiled DLLs around somewhere. > 2. His R is 64 bit, while mine is for 32 bit windows. (I'm not sure how > much of a diference that makes, or whether OSX is 64 bit.) No. His R isn't 64bit. It would probably be slower if it were. The main reason to want 64bit R is to use lots of memory rather than to be fast. > 3. Data is getting swapped to the hard drive, and my hard drive is > slower than his. I chose a slower hard drive to get bigger capacity for > the price. This could be true in principle, but I don't think the matrices are large enough for it to be the main factor. His computer won't be twice as fast on most R tasks (though it will still be twice as pretty, of course). -thomas Thomas Lumley Assoc. Professor, Biostatistics [hidden email] University of Washington, Seattle ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
In reply to this post by richarddmorey
2007/3/10, Richard Morey <[hidden email]>:
> My adviser has a Mac notebook that he bought 6 months ago, and I have a > PC notebook I bought a month ago. Here are the respective specs, as far > as I know them: > > His: > Mac OSX > 1 GB DDR2 RAM > Intel Core Duo, 2 GHz (2MB cache per core) > Unknown HD > > Mine > Windows Vista Home Premium 32bit > 2 GB DDR2 RAM > Intel Core 2 Duo, 2 GHz (4MB cache) > 5400 RPM Hard Drive > > > We are both running R. As a test to see whose laptop was faster, we > decided to invert large random matrices. In R language, it looks like this: > > N=2000 > A=rnorm(N^2) > A=matrix(A,ncol=N) > solve(A) > > This creates a matrix of 4,000,000 random normal deviates and inverts > it. His computer takes about 7 seconds, while mine takes about 14. Why > the difference? I have several working hypotheses, and it would be > interesting to see what you guys think. > > 1. R on Mac was compiled with optimizations for the CPU, with R for > Windows was not. I could test this by compiling R with the Intel > compiler, or GCC with optimizations, and seeing if I get a significant > speed boost. > > 2. His R is 64 bit, while mine is for 32 bit windows. (I'm not sure how > much of a diference that makes, or whether OSX is 64 bit.) > > 3. Data is getting swapped to the hard drive, and my hard drive is > slower than his. I chose a slower hard drive to get bigger capacity for > the price. > > This is not intended to be an OMG MACOS = TEH R0X0R thread. I'm just > trying to explain the discrepency. > > Thanks! > > ______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > Hi, For Windows you can check versions of Rblas.dll linked against the ATLAS library: http://cran.r-project.org/bin/windows/contrib/ATLAS/ Rod. ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
Free forum by Nabble | Edit this page |