Session Ready
Exercise

Benchmark future

You will now benchmark the three functions, fapply_seq(), fapply_mc(), and fapply_cl(), while passing different numbers of cores. Note that since there are no "oisin" and "oscar" servers, instead of passing computer names to fapply_cl() we will simply use the number of nodes. The timing depends on the current load of the DataCamp server. However, for a small number of tasks, one function will be much slower than others. All objects from the two previous exercises are available in your workspace.

Note: Multicore does not work on Windows. We recommend using the 'multiprocess' or 'cluster' plan on Windows computers.

Instructions 1/2
undefined XP
  • 1
  • 2

Benchmark the functions in the following order:

  • fapply_seq() with no arguments, passed to fapply_seq;
  • fapply_mc() with cores = 2, passed to fapply_mc_2;
  • fapply_mc() with cores = 10, passed to fapply_mc_10;
  • fapply_cl() with cores = 2, passed to fapply_cl.