[Rd] strptime(): on Linux system it seems to call system time?

From: Alexander Peterhansl <APeterhansl_at_GAINCapital.com>
Date: Fri, 19 Mar 2010 13:27:08 -0400


[I am herewith re-posting this message on R-devel, as it seems to be the most appropriate mailing list for this issue.]  

Dear List,  

>From what I understand, strptime() simply converts from one class
representation to another; i.e., from character to POSIXct/POSIXlt.  

One strange feature of this command running on Linux is that there are repeated calls to system time (as was revealed in a trace of system calls), which considerably affect performance. These system calls end up taking almost 75% of the execution time, and are completely unnecessary.  

Code:

ptm <- proc.time()

for (i in 1:100000) strptime("2010-03-10 17:00:00", "%F %H:%M:%S")

(proc.time() -ptm)  

Output on Windows Box (32-bit R 2.9.1 running on Intel X5472 @ 3.0 GHz):

   user system elapsed

   1.31 0.02 1.30  

Output on Linux Box (64-bit R 2.10.1 running on Intel Xeon E5520 @ 2.27GHz):

   user system elapsed

   3.33 8.941 12.273  

Any help would be appreciated. Also, if I should turn to a different mailing list for this, please let me know.  

Regards,

Alex

        [[alternative HTML version deleted]]



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 20 Mar 2010 - 16:06:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 20 Mar 2010 - 20:41:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive