The time it takes to knit a book (bookdown) that has a gganimate animated plot in it is quite long, even then re-knitting and having cache=TRUE in the code chunks. The expected behavior would be that the first time knitting it takes a while, the second time almost nothing.
Below there are a few more benchmarks, but, in brief (using CRAN gganimate):
- The time for a clean knit is ~50s.
- The second knit with
cache=TRUE is ~15s (99% time spent in the final pandoc command)
- Commenting out the animate() part, cached knit time goes down to ~2s
- If I add a second gganimated chunk, clean knit and cached knit times are 2x (~30s when cached; 99% time spent in the final
pandoc command)
Weird enough, if I use the Github dev version of gganimate, things are MUCH worse (~170 1st / 110s 2nd knit).
All the code for these tests is in: https://github.com/gorkang/gganimate-bookdown
Posting here before reporting it as a bug, in case I am doing something wrong.
Detailed benchmarks