1. Learn
  2. /
  3. Courses
  4. /
  5. Scalable Data Processing in R

Exercise

How does processing time vary by data size?

If you are processing all elements of two data sets, and one data set is bigger, then the bigger data set will take longer to process. However, it's important to realize that how much longer it takes is not always directly proportional to how much bigger it is. That is, if you have two data sets and one is two times the size of the other, it is not guaranteed that the larger one will take twice as long to process. It could take 1.5 times longer or even four times longer. It depends on which operations are used to process the data set.

In this exercise, you'll use the microbenchmark package, which was covered in the Writing Efficient R Code course.

Note: Numbers are specified using scientific notation $$1e5 = 1 * 10^5 = 100,000$$

Instructions

100 XP
  • Load the microbenchmark package.
  • Use the microbenchmark() function to compare the sort times of random vectors.
  • Call plot() on mb.