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.011 0.027 0.023 #> 2 build 0.013 0.000 0.014 #> 3 render 0.052 0.005 0.057 #> 4 draw 0.321 0.057 0.357 #> 5 TOTAL 0.397 0.089 0.451
benchplot(ggplot(mtcars, aes(mpg, wt)) + geom_point() + facet_grid(. ~ cyl))
#> step user.self sys.self elapsed #> 1 construct 0.011 0.000 0.005 #> 2 build 0.027 0.000 0.027 #> 3 render 0.096 0.003 0.102 #> 4 draw 0.789 0.138 0.866 #> 5 TOTAL 0.923 0.141 1.000