virtualstaticvoid / heroku-buildpack-r

Heroku buildpack for R - Makes deploying R on Heroku easy
MIT License
304 stars 236 forks source link

Slow build time - Caching issue? #157

Closed jaytaytay closed 2 years ago

jaytaytay commented 2 years ago

I am experiencing slow (492 sec) build times, and am not clear if caching is enabled.

The readme indicates that "the buildpack caches the R binaries and installed R packages". When I push to heroku, the R app is detected, which triggers a quite long install. see heroku install.txt (partial) logs for my recent build, 492 seconds. I only have a handful of packages.

I can't tell if this is installing from cache, or downloading fresh each time. Could someone please confirm if this build time is to be expected, and/or if you can tell if caching is enabled by default/in my case?

Thank you! :)

virtualstaticvoid commented 2 years ago

Hi @jaytaytay

I've taken a look at the log you provided; it appears to be for the first deployment of your application.

The caching logic only takes effect on subsequent deployments, as your packages can only be cached once they have been complied during the first deployment.

Trying making a small change to your code and then re-push to Heroku to see if the speed improves. You can expect to see messages such as "Restoring R packages from cache" in the log output, to confirm that the cache is being used.

I hope this helps.

virtualstaticvoid commented 2 years ago

Closing due to inactivity.