$30 off During Our Annual Pro Sale. View details »


Jim Hester
September 19, 2018


The bench package, a new take in benchmarking for R

Jim Hester

September 19, 2018

More Decks by Jim Hester

Other Decks in Programming


  1. CC by RStudio bench ! September 19th 2018 " bench.r-lib.org

    Jim Hester CC-BY-4.0 A new take on benchmarking
  2. Why benchmark?

  3. "premature optimization is the root of all evil." - Donald

  4. "A good programmer… will be wise to look carefully at

    the critical code; but only a!er that code has been identified." - Donald Knuth
  5. "All (tools) should be designed to provide (us) with feedback

    indicating what parts of (our) programs are costing the most" - Donald Knuth
  6. bench::mark()

  7. CC by RStudio bench::mark() 1. High precision timers (ns) 2.

    Memory allocations 3. Number and type of R garbage collections 4. Result equality 5. Adaptive stopping 6. Statistics filter GC effects
  8. CC by RStudio bench::mark() 1. Human readable times 2. Human

    readable memory sizes 3. Full results / timings / GCs in list- cols
  9. bench::press()

  10. CC by RStudio bench::press()

  11. bench::plot()

  12. ggplot2::autoplot(results) CC by RStudio

  13. CC by RStudio

  14. bench.r-lib.org install.packages("bench") jimhester_ jimhester jim.hester@rstudio.com