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.003 0 0.003
#> 2 build 0.015 0 0.014
#> 3 render 0.016 0 0.015
#> 4 draw 0.013 0 0.014
#> 5 TOTAL 0.047 0 0.046
benchplot(ggplot(mtcars, aes(mpg, wt)) + geom_point() + facet_grid(. ~ cyl))
#> step user.self sys.self elapsed
#> 1 construct 0.002 0.000 0.002
#> 2 build 0.025 0.004 0.028
#> 3 render 0.033 0.000 0.033
#> 4 draw 0.026 0.000 0.025
#> 5 TOTAL 0.086 0.004 0.088
# With tidy eval:
p <- expr(ggplot(mtcars, aes(mpg, wt)) + geom_point())
benchplot(!!p)
#> step user.self sys.self elapsed
#> 1 construct 0.001 0 0.001
#> 2 build 0.014 0 0.014
#> 3 render 0.014 0 0.015
#> 4 draw 0.013 0 0.013
#> 5 TOTAL 0.042 0 0.043