

He also compares re-installation times of packages, with RQuantlib going from 500 seconds to a few seconds.

It’s the classic trade-off between memory (caching) and CPU.ĭirk’s post gives clear details on how to implement ccache (so I won’t repeat). If that file is ever compiled again, instead of rebuilding, ccache returns the object code, resulting in a significant speed up. Essentially, ccache stores the resulting object file created when compiling. A few years ago, Dirk Eddelbuettel wrote a great blog post on leveraging the ccache utility for reducing the compile time step. tar.gz files, then most of the installation time is spent on compiling source code, such as C, C++ & Fortran. If you are installing packages from source, i.e. The free version of travis only comes with a single core, but if you hook up a multi-core Kubernettes cluster to your CI (we sometimes do this at Jumping Rivers), then you can achieve a large speed-up. It would in theory speed-up continuous integration pipelines, but only if you have multiple cores available. In short, this is something you should definitely use and add to your. For further information, see our blog post from a few years ago. Not bad for a simple tweak with no downsides. When installing a fresh version of the tidyverse and all dependencies, this can give a two-fold speed-up. Install.packages( "tidyverse", Ncpus = 6) Using it is easy it’s just an additional argument in install.packages(). It doesn’t speed up an individual package installs, but it does allow dependencies to install in parallel, e.g. tidyverse. The first tactic you should use is the Ncpus argument in install.packages() and update.packages(). If I’ve missed any, let me know ( )!ĭo you use Professional Posit Products? If so, checkout out our managed Posit services The purpose of this blog post is to pull together a few different methods for tackling this problem. This is a problem we often solve for our clients - optimising their CI/CD pipelines. Or we are simply updating a large number of packages via update.packages(). Or we are using more continuous integration strategies such as Travis or GitLab-CI, and want quick feedback. For example, packages are getting larger and more complex (tidyverse and friends), so installation just takes longer. The bigger picture is that package installation time is starting to become more of an issue for a number of reasons. Every few weeks or so, a tweet pops up asking about how to speed up package installation in Rĭepending on the luck of twitter, the author may get a few suggestions.
