On Thu, Sep 1, 2011 at 5:13 PM, Dirk Eddelbuettel <[email protected]> wrote:
> Uh-oh. Factor 10. Wow.

Yeah, huh?  To be fair, this example is ultra-contrived.  The *only*
thing that happened was indexing.
Is it possible that compiler magic (ala loop unrolling that isn't done
for () ) accounts for any of the speedup?  I have basically no
experience with this.

> Matrix is different because we cannot do [i, j] for C legacy reasons. So both
> variants may be fast...

Yeah, but we *can* do linear access of a matrix with something like [
i+nrow*j ], which shouldn't have any bound checking (right??).  I
still don't see how linear bracket access on a matrix doesn't behave
the same as linear bracket access on vector compared to their
respective () behaviors...

-xian

-- 
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal – Panama!
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to