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

bench

Jim Hester
September 19, 2018

 bench

The bench package, a new take in benchmarking for R

Jim Hester

September 19, 2018
Tweet

More Decks by Jim Hester

Other Decks in Programming

Transcript

  1. CC by RStudio
    bench !
    September 19th 2018
    " bench.r-lib.org
    Jim Hester
    CC-BY-4.0
    A new take on benchmarking

    View Slide

  2. Why
    benchmark?

    View Slide

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

    View Slide

  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

    View Slide

  5. "All (tools) should be designed to
    provide (us) with feedback
    indicating what parts of (our)
    programs are costing the most"
    - Donald Knuth

    View Slide

  6. bench::mark()

    View Slide

  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

    View Slide

  8. CC by RStudio
    bench::mark()
    1. Human readable times
    2. Human readable memory sizes
    3. Full results / timings / GCs in list-
    cols

    View Slide

  9. bench::press()

    View Slide

  10. CC by RStudio
    bench::press()

    View Slide

  11. bench::plot()

    View Slide

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

    View Slide

  13. CC by RStudio

    View Slide

  14. bench.r-lib.org
    install.packages("bench")
    jimhester_
    jimhester
    [email protected]

    View Slide