[R-SIG-Finance] Performance comparison xts v. zoo

Gabor Grothendieck ggrothendieck at gmail.com
Wed Jan 19 15:10:11 CET 2011


On Wed, Jan 19, 2011 at 8:32 AM, Dirk Eddelbuettel <edd at debian.org> wrote:
>
> Hi Ryan,
>
> On 19 January 2011 at 08:08, Sheftel, Ryan wrote:
> | I am looking for a comparison of the performance speed between xts and
> | zoo on time series. I remember once seeing this in a pdf document,
> | perhaps a magazine article?, but after extensive google-ing I have come
> | up blank.
> |
> | Any direction would be helpful before I reproduce the results myself.
>
> Xts on the other hand has compiled C and Fortran code for key operations
> making it very fast (and generally faster than zoo), as well as powerful.

> One example is the ISO8601 date parsing which can subset based on
> human-readable strings such as "2011-01-18 10:00/2011-01-19 10:30" getting
> you just that half-hour interval yesterday on intra-day data in an xts
> object.

That is not truly an example.

A true example would be that xts has C code for merge whereas zoo has
R code.  Thus merges and functionality depending on merges could be
expected to be faster in xts.

On the other hand, comparing time operations is not a good example.
Parsing times are not a part of zoo nor are time operations in
general.  zoo defines an API that allows it to use any time class that
supports certain time/date methods (and all popular ones and most
lesser known ones do as do many classes that are not ordinarily
thought of as time classes) whereas xts hard codes these so the
"example" is really comparing particular time class methods, not part
of zoo, with hard coded functionality in xts.   Relative speeds would
depend on the particular time class and its implementation.

The one implication for speed is that if a new faster time class comes
along then zoo could likely use it without modifying zoo whereas xts
would have to be modified to handle it.

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-SIG-Finance mailing list