Shiny DT very slow

Using shiny::renderDataTable is considerably faster than DT::renderDataTable for both very large and even very small (181) tables in a shiny app. This has been tested on windows and a linux based shiny server with the same results. I have tried variations of all of the options, including server=FALSE and server=TRUE. Unfortunately, it looks like there is an error with shiny::renderDataTable on the linux server (shiny 1.3.2 renderDataTable() can't work now), and this function is being deprecated. Thus, I am stuck with DT::renderDataTable.

Does anyone know why DT:renderDataTable would render and interact so slowly compared to the shiny equivalent?

1 Like

I do not know, but have you tried using a proxy? I use proxy for updating most output in shiny.

ui:

  dataTableOutput("avtable", width = "100%")

server:

  output$avtable <- renderDataTable({
   # do this once only
    datatable(...)
  })

  avtable_proxy <- dataTableProxy("avtable", session = session)

  observeEvent(avbv(), {
   # this is how an example of how you update it
    av <- avbv()
    replaceData(avtable_proxy, as.data.frame(av), resetPaging = FALSE)
  })