Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

Why benchmark?

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

"A good programmer… will be wise to look carefully at the critical code; but only a!er that code has been identified." - Donald Knuth

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

bench::mark()

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

bench::press()

Slide 10

Slide 10 text

CC by RStudio bench::press()

Slide 11

Slide 11 text

bench::plot()

Slide 12

Slide 12 text

ggplot2::autoplot(results) CC by RStudio

Slide 13

Slide 13 text

CC by RStudio

Slide 14

Slide 14 text

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