Colin Gillespie shows off an R package for benchmarking:
Of course, it’s more likely that you’ll want to compare more than two things. You can compare as many function calls as you want with
mark()
, as we’ll demonstrate in the following example. It’s probably more likely that you’ll want to compare these function calls against more than one value. For example, in the digest package there are eight different algorithms. Ranging from the standardmd5
to the newerxxhash64
methods. To compare times, we’ll generaten = 20
random character strings of lengthN = 10,000
. This can all be wrapped up in the single functionpress()
function call from the bench package:
Click through for an example involving hashing algorithms.
Comments closed