[Rcpp-devel] NumericVector Double mismatch when indexing an array

Darren Cook darren at dcook.org
Wed Sep 26 02:12:00 CEST 2012


>> benchmark(fun1(), fun2(), fun3(), fun4(), order = "relative",
> replications = 1e5L)
>     test replications elapsed relative user.self sys.self user.child
> sys.child
> 4 fun4()       100000    6.16    1.000      6.06        0         NA
> NA
> 3 fun3()       100000    6.19    1.005      5.91        0         NA
> NA
> 2 fun2()       100000    6.92    1.123      6.75        0         NA
> NA
> 1 fun1()       100000   13.01    2.112     12.73        0         NA
> NA

An interesting thread, thanks for the benchmarks. I just wanted to point
out that even with 100,000 replications, noise is altering the ordering:
fun3() is quicker when considering user.self instead of elapsed.

(Are there any ways, built-in to benchmark, to avoid this? E.g. do
multiple runs, and average, or just use quickest run, etc.?)

Darren



More information about the Rcpp-devel mailing list