[R] Run times for tree(): R versus S-Plus

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Nov 22 18:41:56 CET 1999


------------- Begin Forwarded Message -------------

Date: Mon, 22 Nov 1999 17:08:12 +0000 (GMT)
From: Prof Brian Ripley <ripley at toucan.stats>
Subject: Re: [R] Run times for tree(): R versus S-Plus
To: david_m_potter at groton.pfizer.com

> From: "Potter, David M" <david_m_potter at groton.pfizer.com>
> Date: Mon, 22 Nov 1999 10:25:21 -0500
> 
> I have a noticed an appreciable difference in run times
> between tree() in R and tree() in S-Plus.  In the example
> below, with 300 binary predictors, a single binary response
> (which I am treating as a factor), and 300 observations, R
> takes 29 seconds while S-Plus takes about 2 seconds.

Entirely possible, _but_ I would recommend using rpart in both.

> For 1000 binary predictors and 1000 observations (results
> not shown), R takes about 15 minutes while S-Plus takes
> about 28 seconds.
> 
> Modifying the amount of heap memory requested by R at
> startup affects the run times somewhat, but the difference
> between R and S-Plus persists.
> 
> Has anybody else observed this?  If so, is the difference
> due to differences between the two tree() functions, or
> perhaps differences in the way each program handles memory?

It is due to differences between R and S. The R algorithm (which is my
Tree library for S) runs faster than tree under S-PLUS 3.4 (S tree 7.4
secs, S Tree  6.2 secs,  R t/Tree 93 secs).  Similarly rpart runs much
slower under R than S-PLUS 3.4 (56 seconds vs 7.4 seconds). (All
times on an old Sparc 20.)

This is with R-0.90.0, standard memory ration (as rpart and 0.65.1
do not mix due to a bug in diag in the latter).

Note though that your test is not a realistic one: there is no
structure there to find. I do not see dramatic differences in real
examples.  The V&R3 scripts for Chapter 10 (trees) take 86 secs in
S-PLUS 3.4, 122 secs in R.

I will try to do some profiling on this, but no promises.

-- 
Brian D. Ripley,                  ripley at 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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


------------- End Forwarded Message -------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list