plotlyOutput renderplotly

I use plotly in R for implementing it in my shiny app, but it’s sooooo slow.

My code for generating the data frames and variables to render the plotly scatter 3d plot etc literally take less than 3 seconds to make. I have used the tic() tac() functions to clock the processes. To render plotly inside the Shiny App I’m building takes 10-20 seconds however every single time. I’ve seen other people post about this in some forums, but I have yet to discover any news about the cause and solutions for it.
Does anyone know why it is so slow or how we can solve this?

cheers, Mark