File: benchmark.Rd

package info (click to toggle)
r-cran-tmb 1.9.17-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,344 kB
  • sloc: cpp: 52,049; ansic: 382; makefile: 11
file content (57 lines) | stat: -rw-r--r-- 1,536 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/benchmark.R
\name{benchmark}
\alias{benchmark}
\alias{plot.parallelBenchmark}
\title{Benchmark parallel templates}
\usage{
benchmark(obj, n = 10, expr = NULL, cores = NULL)

\method{plot}{parallelBenchmark}(x, type = "b", ..., show = c("speedup", "time"), legendpos = "topleft")
}
\arguments{
\item{obj}{Object from \code{MakeADFun}}

\item{n}{Number of replicates to obtain reliable results.}

\item{expr}{Optional expression to benchmark instead of default.}

\item{cores}{Optional vector of cores.}

\item{x}{Object to plot}

\item{type}{Plot type}

\item{...}{Further plot arguments}

\item{show}{Plot relative speedup or relative time?}

\item{legendpos}{Position of legend}
}
\description{
Benchmark parallel templates

Plot result of parallel benchmark
}
\details{
By default this function will perform timings of the most critical
parts of an AD model, specifically
\enumerate{
\item Objective function of evaluated template.
\item Gradient of evaluated template.
\item Sparse hessian of evaluated template.
\item Cholesky factorization of sparse hessian.
}
(for pure fixed effect models only the first two).
Expressions to time can be overwritten by the user (\code{expr}).
A \code{plot} method is available for Parallel benchmarks.
}
\examples{
\dontrun{
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)
}
}