
Benchmark plot creation time. Broken down into construct, build, render and draw times.
Source:R/bench.R
benchplot.RdBenchmark 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.005 0 0.005
#> 2 build 0.025 0 0.025
#> 3 render 0.040 0 0.040
#> 4 draw 0.017 0 0.016
#> 5 TOTAL 0.087 0 0.086
benchplot(ggplot(mtcars, aes(mpg, wt)) + geom_point() + facet_grid(. ~ cyl))
#> step user.self sys.self elapsed
#> 1 construct 0.005 0 0.005
#> 2 build 0.026 0 0.026
#> 3 render 0.089 0 0.089
#> 4 draw 0.032 0 0.031
#> 5 TOTAL 0.152 0 0.151
# With tidy eval:
p <- expr(ggplot(mtcars, aes(mpg, wt)) + geom_point())
benchplot(!!p)
#> step user.self sys.self elapsed
#> 1 construct 0.004 0 0.004
#> 2 build 0.024 0 0.024
#> 3 render 0.037 0 0.036
#> 4 draw 0.019 0 0.018
#> 5 TOTAL 0.084 0 0.082