Closed annakrystalli closed 2 years ago
So! In the end there was a much simpler fix to the problem! Due to some data reshaping required before plotting each beak, the original code was extracting and rendering each segment of each beak (75 for each) individually in a for loop, effectively running the most expensive function 75 times per beak.
Can't believe I missed that! 🙈 . In any case I know all the beak coordinates first and then render the whole beak in a single segments3d
, and it's as fast as! No fancy methods required! 🎉
Done but slow. See https://github.com/dmurdoch/rgl/issues/4
Options:
promises
package is the first thing I considered (https://rstudio.github.io/promises/articles/shiny.html) but that still means the loading of the scene is slow, it just doesn't make the rest of the page hang.