| summary.bench_mark {bench} | R Documentation |
Summarize bench::mark results.
## S3 method for class 'bench_mark' summary(object, filter_gc = TRUE, relative = FALSE, time_unit = NULL, ...)
object |
bench_mark object to summarize. |
filter_gc |
If |
relative |
If |
time_unit |
If |
... |
Additional arguments ignored. |
If filter_gc == TRUE (the default) runs that contain a garbage
collection will be removed before summarizing. This is most useful for fast
expressions when the majority of runs do not contain a gc. Call
summary(filter_gc = FALSE) if you would like to compute summaries with
these times, such as expressions with lots of allocations when all or most
runs contain a gc.
A tibble with the additional summary columns. The following summary columns are computed
min - bench_time The minimum execution time.
mean - bench_time The arithmetic mean of execution time
median - bench_time The sample median of execution time.
max - bench_time The maximum execution time.
mem_alloc - bench_bytes Total amount of memory allocated by running the expression.
itr/sec - integer The estimated number of executions performed per second.
n_itr - integer Total number of iterations after filtering
garbage collections (if filter_gc == TRUE).
n_gc - integer Total number of garbage collections performed over all
iterations. This is a psudo-measure of the pressure on the garbage collector, if
it varies greatly between to alternatives generally the one with fewer
collections will cause fewer allocation in real usage.
dat <- data.frame(x = runif(10000, 1, 1000), y=runif(10000, 1, 1000)) # `bench::mark()` implicitly calls summary() automatically results <- bench::mark( dat[dat$x > 500, ], dat[which(dat$x > 500), ], subset(dat, x > 500)) # However you can also do so explicitly to filter gc differently. summary(results, filter_gc = FALSE) # Or output relative times summary(results, relative = TRUE)