jumpingrivers.com - colin@jumpingrivers.com

About

My R code is slow

Buy a better computer!

Or should you?

benchmarkme

library("benchmarkme")## On CRAN

benchmarkme

library("benchmarkme")## On CRAN
## Tests based on a script by
## Simon Urbanek & Douglas Bates
res = benchmark_std(runs = 3)

benchmarkme

library("benchmarkme")
res = benchmark_std(runs = 3)
# # Programming benchmarks (5 tests):
#     3,500,000 Fibonacci numbers calculation (vector calc): 0.52 (sec).
#     Grand common divisors of 1,000,000 pairs (recursion): 0.965 (sec).
#     Creation of a 3500x3500 Hilbert matrix (matrix calc): 0.306 (sec).
#     Creation of a 3000x3000 Toeplitz matrix (loops): 11.5 (sec).
#     Escoufier's method on a 60x60 matrix (mixed): 1.17 (sec).
# # Matrix calculation benchmarks (5 tests):
#    Creation, transp., deformation of a 5000x5000 matrix: 0.794 (sec).
#    2500x2500 normal distributed random matrix ^1000: 0.522 (sec).
#    Sorting of 7,000,000 random values: 0.598 (sec).
#    2500x2500 cross-product matrix (b = a' * a): 6.56 (sec).
#    Linear regr. over a 3000x3000 matrix (c = a \ b'): 4.5 (sec).
# # Matrix function benchmarks (5 tests):

benchmarkme

# Upload results +
# RAM, CPU, 
# OS, byte-compile, BLAS
upload_results(res)

benchmarkme

plot(res)

Uploaded results

Hardware: RAM

Results: Programming benchmarks

And the winner is….

Results: Matrix benchmarks

Intel CPU Differences (relative times)

Input/output benchmark_io

Amazon AWS

  • Over all relatively fast

  • Little difference between tiers
    • General, memory, compute
  • If you have no other considerations, go for the cheapest

Summary

The benchmarkme package

  • github page
  • CRAN

    install.packages("benchmarkme")
    browseVignettes("benchmarkme")
  • Original benchmark scripts

Links