<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rense Nieuwenhuis &#187; system.time</title>
	<atom:link href="http://www.rensenieuwenhuis.nl/tag/systemtime/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rensenieuwenhuis.nl</link>
	<description>&#34;The extra-ordinary lies within the curve of normality&#34;</description>
	<lastBuildDate>Thu, 12 Mar 2026 14:58:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.2</generator>
	<item>
		<title>R-Sessions 28: Impressive R Speeds</title>
		<link>http://www.rensenieuwenhuis.nl/r-sessions-28-impressive-r-speeds/</link>
		<comments>http://www.rensenieuwenhuis.nl/r-sessions-28-impressive-r-speeds/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 10:00:22 +0000</pubDate>
		<dc:creator><![CDATA[Rense Nieuwenhuis]]></dc:creator>
				<category><![CDATA[R-Sessions]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[matrix]]></category>
		<category><![CDATA[R-Project]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[system.time]]></category>

		<guid isPermaLink="false">http://www.rensenieuwenhuis.nl/?p=778</guid>
		<description><![CDATA[Yesterday, I received my new Apple MacBook. It's running a Core 2 Duo at 2.4 Ghz and it's fast. Really fast! I tested it with using R-Project, doing some timings on matrix transformations.

Apparently, it's very cool to show of the speed of R-Project on your system. Optimized .DLL files help to speed up your R on Windows systems (and possibly other systems as well) with respect to matrix transformations, which has led to enormous speed increases. So, let's perform a speed-test of our own.]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.rensenieuwenhuis.nl/archive/category/r-project/r-sessions/"><img title="R-Sessions" src="http://i1.wp.com/www.rensenieuwenhuis.nl/wp-content/uploads/2008/07/r-sessions.jpg?w=470" alt="" data-recalc-dims="1" /></a> </p>
<p>Yesterday, I received my new Apple MacBook. It&#8217;s running a Core 2 Duo at 2.4 Ghz and it&#8217;s fast. Really fast!</p>
<p>Apparently, it&#8217;s very cool to show of the speed of R-Project on your system. <a href="http://cran.r-project.org/bin/windows/contrib/ATLAS/">Optimized .DLL files</a> help to speed up your R on Windows systems (and possibly other systems as well) with respect to matrix transformations, which has led to enormous speed increases. So, let&#8217;s perform a speed-test of our own.<br />
<span id="more-778"></span></p>
<p>First of all, in the syntax below, the Matrix package is activated, using the require() command. Since we will be creating random data, we set the seed in order to receive the exact same data every time the test is run. This is done with set.seed(). The next line creates a matrix X, which in the last three lines is manipulated in different ways. </p>
<p>To test how long this takes, we enclose that matrix operations in the system.time() function, which clocks the operation.</p>
<p><code><br />
require(Matrix)<br />
set.seed(123)<br />
X <- Matrix(rnorm(1e6), 1000)<br />
system.time(for(i in 1:25) X%*%X)<br />
system.time(for(i in 1:25) solve(X))<br />
system.time(for(i in 1:10) svd(X))<br />
</code></p>
<p>This results in the following output:</p>
<p><code><br />
> X <- Matrix(rnorm(1e6), 1000)<br />
> system.time(for(i in 1:25) X%*%X)<br />
   user  system elapsed<br />
  8.306   0.591   5.031<br />
> system.time(for(i in 1:25) solve(X))<br />
   user  system elapsed<br />
  8.933   1.331   6.684<br />
> system.time(for(i in 1:10) svd(X))<br />
   user  system elapsed<br />
 36.989   3.665  33.384<br />
 </code></p>
<p>WOW! This is the <a href="http://stijnr.socsci.ru.nl/blog/?p=228">fastest I've seen in real life</a>, even faster than some of the desktops that I know people currently work with (i.e. my own). I'm however very sure that it is not the fastest possible, not to say compared with how fast future calculations will be. </p>
<p>Additionally, in the near future my MacBook will be configured with 4 Gb RAM, so I'm curious to find out whether or not this will result in an additional speed increase. I expect, however, most benefit from the additional RAM when doing binomial mixed effects models, so of course expect a comparative benchmark on that one as well as soon as the new RAM arrives.</p>
<p>So, in the meantime, you can use this code to do some benchmarks yourself, on various computers. Please post the results here, or discuss them in the R-Sessions Forum.</p>
<p>UPDATE:<br />
I also tested my old Powerbook G4 (1.5 Ghz, 1.25 Gb RAM):<br />
<code><br />
> set.seed(123)<br />
> X <- Matrix(rnorm(1e6), 1000)<br />
> system.time(for(i in 1:25) X%*%X)<br />
   user  system elapsed<br />
 34.661   1.590  47.528<br />
> system.time(for(i in 1:25) solve(X))<br />
   user  system elapsed<br />
 37.184   1.656  51.516<br />
> system.time(for(i in 1:10) svd(X))<br />
   user  system elapsed<br />
247.694  11.258 331.979<br />
</code></p>
<p><!--adsense--></p>
<p>- - -- --- ----- --------</p>
<ul>
<li><strong><a href="http://www.rensenieuwenhuis.nl/r-forum/topic/r-sessions-28-impressive-r-speeds">Discuss this article and pose additional questions in the R-Sessions Forum</a></strong></li>
</ul>
<p>- - -- --- ----- --------<br />
<a href="http://www.rensenieuwenhuis.nl/archive/category/r-project/r-sessions/">R-Sessions</a> is a collection of manual chapters for R-Project, which are maintained on <a href="www.rensenieuwenhuis.nl">Curving Normality</a>. All posts are linked to the chapters from the R-Project manual on this site. The manual is free to use, for it is paid by the advertisements, but please refer to it in your work inspired by it. Feedback and topic requests are highly appreciated.<br />
-------- ----- --- -- - -</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rensenieuwenhuis.nl/r-sessions-28-impressive-r-speeds/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
