
Benchmark plot creation time. Broken down into construct, build, render and draw times.
Source:R/bench.R
benchplot.Rd
Benchmark plot creation time. Broken down into construct, build, render and draw times.
Examples
benchplot(ggplot(mtcars, aes(mpg, wt)) + geom_point())
#> step user.self sys.self elapsed
#> 1 construct 0.003 0 0.003
#> 2 build 0.020 0 0.021
#> 3 render 0.022 0 0.021
#> 4 draw 0.019 0 0.019
#> 5 TOTAL 0.064 0 0.064
benchplot(ggplot(mtcars, aes(mpg, wt)) + geom_point() + facet_grid(. ~ cyl))
#> step user.self sys.self elapsed
#> 1 construct 0.003 0 0.003
#> 2 build 0.024 0 0.024
#> 3 render 0.051 0 0.052
#> 4 draw 0.033 0 0.034
#> 5 TOTAL 0.111 0 0.113
# With tidy eval:
p <- expr(ggplot(mtcars, aes(mpg, wt)) + geom_point())
benchplot(!!p)
#> step user.self sys.self elapsed
#> 1 construct 0.002 0 0.002
#> 2 build 0.021 0 0.021
#> 3 render 0.022 0 0.022
#> 4 draw 0.020 0 0.019
#> 5 TOTAL 0.065 0 0.064