durBase <- map(distributions, ~microbenchmark::microbenchmark(hist(.x)))
durGgplot <- map(distributions, ~microbenchmark::microbenchmark(qplot(.x)))
dt_durations <- bind_rows(map(durBase, summary), map(durGgplot, summary)) %>%
mutate(sample = rep(c(10^2, 10^3, 10^4, 10^5),2))
dt_durations
## expr min lq mean median uq max
## 1 hist(.x) 38.336860 54.501315 60.060890 59.531071 64.394342 95.51217
## 2 hist(.x) 49.352128 57.640673 61.879470 61.280147 65.104232 85.97245
## 3 hist(.x) 47.998929 53.813954 57.569624 57.364648 61.048715 71.24887
## 4 hist(.x) 39.912776 59.313690 63.146085 63.132119 67.026831 86.24658
## 5 qplot(.x) 2.679383 2.860507 4.502420 3.236379 4.739060 21.37262
## 6 qplot(.x) 2.710356 3.001929 4.461167 3.377924 4.607217 17.22505
## 7 qplot(.x) 2.694769 3.131219 4.681951 3.763796 5.195556 14.68402
## 8 qplot(.x) 2.715436 2.945233 4.049377 3.380630 4.048654 15.03824
## neval sample
## 1 100 1e+02
## 2 100 1e+03
## 3 100 1e+04
## 4 100 1e+05
## 5 100 1e+02
## 6 100 1e+03
## 7 100 1e+04
## 8 100 1e+05
ggplot(data = dt_durations) +
geom_line(aes(x = sample, y = median, color = expr)) +
ylim(0,NA)
