[R-SIG-Mac] Re : R 2.1.1 for optimized for G5+Tiger

joerg van den hoff j.van_den_hoff at fz-rossendorf.de
Fri Jun 24 10:14:30 CEST 2005


Simon Urbanek wrote:
> Hi Jörg,
> 
> On Jun 23, 2005, at 12:14 PM, joerg van den hoff wrote:
> 
>> I tried  a run of 1000 non-linear fits (i.e. all the time is spent  in 
>> "nls" and friends).
>> I found no significant difference in the system.time() output  (2.1.1. 
>> seemed even a bit slower). both took about 22-24 sec. did a  miss 
>> something?
> 
> 
> I didn't look at the implementation of nls, but If the time is spent  
> mostly in vecLib or R code, there should be no difference. The  
> optimization usually gains only a few percent. I suspect that Naji's  
> speed up is due to the update of R.app, because it's running the  event 
> loop less frequently (there should be posts about that on the  archives) 
> - it used to slow down R. Unfortunately most of the really  fast 
> optimizations don't apply to R, because R uses doubles most of  the time 
> and they cannot be vectorized. Still, C/C++ code should  benefit from 
> the optimization (I wonder why it should run slower,  that's really 
> startling).

hi simon,

if this is of interest: here's (part of) the summaryRprof() output:

$by.self
                           self.time self.pct total.time total.pct
"names"                        0.80      6.5       0.94       7.6
"$"                            0.60      4.9       0.60       4.9
"<Anonymous>"                  0.38      3.1       5.42      44.0
"as.double"                    0.38      3.1       0.64       5.2
"eval"                         0.36      2.9       2.66      21.6
"lapply"                       0.34      2.8       1.26      10.2
"assign"                       0.30      2.4       1.58      12.8
"names<-"                      0.30      2.4       0.38       3.1
"summary.nls"                  0.28      2.3       1.94      15.7
"seq"                          0.26      2.1       0.72       5.8
"seq.default"                  0.26      2.1       0.46       3.7
"nlsModel"                     0.24      1.9       1.52      12.3
"[<-.data.frame"               0.24      1.9       1.08       8.8
"paste"                        0.24      1.9       0.52       4.2
"as.integer"                   0.24      1.9       0.38       3.1
"confidence"                   0.22      1.8      12.32     100.0
".Call"                        0.20      1.6       4.92      39.9
"qr.coef"                      0.20      1.6       1.32      10.7
"qr"                           0.20      1.6       0.70       5.7
"inherits"                     0.20      1.6       0.30       2.4
"=="                           0.20      1.6       0.20       1.6
"model.frame.default"          0.18      1.5       1.12       9.1
"storage.mode<-"               0.18      1.5       0.94       7.6
"array"                        0.18      1.5       0.66       5.4
"as.double.default"            0.18      1.5       0.18       1.5
"as.matrix"                    0.16      1.3       0.42       3.4
"[.data.frame"                 0.16      1.3       0.34       2.8
".Fortran"                     0.14      1.1       0.14       1.1
"names.default"                0.14      1.1       0.14       1.1

which of these are compiled code I don't know in detail, but most of 
them (except 'confidence', 'nlsModel', summary.nls) probably are 
('names', '$', '.Call', 'qr', '.Fortran' ...).

"slow down": well, the difference was insignificant ( ~ 24 vs. 22.5 s, 
which lies more ore less within the natural fluctuation for repeated 
runs anyway). so, there seems to be no (positive or negative) effect of 
the optimization as far as the above situation is  concerned.

regards,
joerg



More information about the R-SIG-Mac mailing list