benchmark | R Documentation |
Benchmark parallel templates
Plot result of parallel benchmark
benchmark(obj, n = 10, expr = NULL, cores = NULL)
## S3 method for class 'parallelBenchmark'
plot(x, type = "b", ..., show = c("speedup", "time"), legendpos = "topleft")
obj |
Object from |
n |
Number of replicates to obtain reliable results. |
expr |
Optional expression to benchmark instead of default. |
cores |
Optional vector of cores. |
x |
Object to plot |
type |
Plot type |
... |
Further plot arguments |
show |
Plot relative speedup or relative time? |
legendpos |
Position of legend |
By default this function will perform timings of the most critical parts of an AD model, specifically
Objective function of evaluated template.
Gradient of evaluated template.
Sparse hessian of evaluated template.
Cholesky factorization of sparse hessian.
(for pure fixed effect models only the first two).
Expressions to time can be overwritten by the user (expr
).
A plot
method is available for Parallel benchmarks.
## Not run:
runExample("linreg_parallel",thisR=TRUE) ## Create obj
ben <- benchmark(obj,n=100,cores=1:4)
plot(ben)
ben <- benchmark(obj,n=10,cores=1:4,expr=expression(do.call("optim",obj)))
plot(ben)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.