Skip to content
Prev 16108 / 63424 Next

Varying as.Date performance

One other possibly difference would be locale, but this is slow on FC3 
(2.3.4 now) in the C locale.  Almost all the time is in strptime:
R profiling shows
$by.self
                     self.time self.pct total.time total.pct
"strptime"              29.58     99.7      29.58      99.7
"as.Date.character"      0.10      0.3      29.68     100.0
"as.Date"                0.00      0.0      29.68     100.0
"eval"                   0.00      0.0      29.68     100.0
"system.time"            0.00      0.0      29.68     100.0

Now on a glibc 2.3.x system R's internal replacement for strptime will be 
used (to work around bugs) so it must be some other part of the POSIX 
time-handling that has changed.

The next step would be to do C-level profiling and then retrofit the 
crucial code from glibc 2.3.2.

It does seem a pretty unusual application of R for 10^5 date conversions 
to be needed and for 30 secs to be an appreciable part of the analysis 
time on such a data set.
On Wed, 4 May 2005, Jeff Enos wrote: