
Benchmark plot creation time. Broken down into construct, build, render and draw times.
Source:R/bench.R
benchplot.Rd
Benchmark 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.004
#> 2 build 0.026 0 0.026
#> 3 render 0.039 0 0.039
#> 4 draw 0.019 0 0.019
#> 5 TOTAL 0.089 0 0.088
benchplot(ggplot(mtcars, aes(mpg, wt)) + geom_point() + facet_grid(. ~ cyl))
#> step user.self sys.self elapsed
#> 1 construct 0.004 0 0.005
#> 2 build 0.028 0 0.027
#> 3 render 0.088 0 0.088
#> 4 draw 0.034 0 0.033
#> 5 TOTAL 0.154 0 0.153
# With tidy eval:
p <- expr(ggplot(mtcars, aes(mpg, wt)) + geom_point())
benchplot(!!p)
#> step user.self sys.self elapsed
#> 1 construct 0.005 0.000 0.004
#> 2 build 0.024 0.001 0.025
#> 3 render 0.038 0.000 0.038
#> 4 draw 0.019 0.000 0.019
#> 5 TOTAL 0.086 0.001 0.086