Benchmark plot creation time. Broken down into construct, build, render and draw times.

benchplot(x)

Arguments

x

code to create ggplot2 plot

Examples

benchplot(ggplot(mtcars, aes(mpg, wt)) + geom_point())
#> step user.self sys.self elapsed #> 1 construct 0.003 0.000 0.003 #> 2 build 0.015 0.000 0.015 #> 3 render 0.041 0.001 0.042 #> 4 draw 0.035 0.000 0.035 #> 5 TOTAL 0.094 0.001 0.095
benchplot(ggplot(mtcars, aes(mpg, wt)) + geom_point() + facet_grid(. ~ cyl))
#> step user.self sys.self elapsed #> 1 construct 0.004 0.000 0.003 #> 2 build 0.027 0.000 0.028 #> 3 render 0.088 0.001 0.089 #> 4 draw 0.058 0.000 0.058 #> 5 TOTAL 0.177 0.001 0.178