rstudio / packrat

Packrat is a dependency management system for R
http://rstudio.github.io/packrat/
401 stars 89 forks source link

Optimise package search tree and insert verbose logger messages #614

Closed andrie closed 3 years ago

andrie commented 3 years ago

Packrat searches for recursive dependencies in the getPackageRecords() function.

However, if a package appears multiple times in the search tree, this recursion will run multiple times.

This PR optimizes the search tree by memorizing whether a package was searched before, and if so, skips the search the next time.

For my test case, this reduces the packrat snapshot time from 71 sec to 14 sec.

aronatkins commented 3 years ago

Replaced by https://github.com/rstudio/packrat/pull/615 (now merged).