R/bench.R
benchplot.Rd
Benchmark plot creation time. Broken down into construct, build, render and draw times.
benchplot(x)
benchplot(ggplot(mtcars, aes(mpg, wt)) + geom_point())
#> step user.self sys.self elapsed
#> 1 construct 0.002 0 0.002
#> 2 build 0.016 0 0.016
#> 3 render 0.018 0 0.018
#> 4 draw 0.015 0 0.015
#> 5 TOTAL 0.051 0 0.051
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.032 0 0.033
#> 3 render 0.037 0 0.038
#> 4 draw 0.026 0 0.027
#> 5 TOTAL 0.098 0 0.101
# 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.019 0 0.020
#> 3 render 0.017 0 0.016
#> 4 draw 0.024 0 0.024
#> 5 TOTAL 0.062 0 0.062