[Rcpp-devel] Rcpp "version" of R's match function

Hadley Wickham h.wickham at gmail.com
Fri Nov 16 18:03:44 CET 2012


> Ouch. Simon wins:
>
>                   expr      min        lq    median        uq      max
> 1  fmatch(xx, letters)  59.4727  60.29989  74.18049  77.94288 112.2938
> 2 match__(xx, letters) 137.3878 137.77486 138.33766 152.14018 193.3748
> 3  match_(xx, letters) 147.7115 148.36442 149.20221 162.82343 171.3181
> 4   match(xx, letters) 288.4345 293.10380 294.58833 296.26125 333.1210

But only because he builds up the hash table once - the others have to
do it every time.

Hadley


-- 
RStudio / Rice University
http://had.co.nz/


More information about the Rcpp-devel mailing list