How to Profile Rhino App Perfomance #488
-
Hi I'm struggling to find an easy way to profile the performance of my app. It seems the commonly used methods (profvis, proftools) do not work well with how a Rhino app is structured. Adding proftools calls inside the application breaks the app functionality. Trying to add profvis_ui into my app breaks the app functionality and makes much of the UI not render. Trying to run the app in Rstudio and use profvis there yields an error I don't get when running the app by its own:
Which is quite confusing as the box documentation indeed doesn't include |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @StephenWist , # app/main.R
box::use(
shiny[actionButton, callModule, fluidPage, moduleServer, NS, plotOutput, renderPlot],
profvis[profvis_ui, profvis_server],
ggplot2[aes, diamonds, ggplot, geom_point],
)
#' @export
ui <- function(id) {
ns <- NS(id)
fluidPage(
plotOutput(ns("plot")),
actionButton(ns("new"), "New plot"),
profvis_ui(ns("profiler"))
)
}
#' @export
server <- function(id) {
moduleServer(id, function(input, output, session) {
callModule(profvis_server, "profiler")
output$plot <- renderPlot({
input$new
ggplot(diamonds, aes(carat, price)) + geom_point()
})
})
}
Regarding |
Beta Was this translation helpful? Give feedback.
Hi @StephenWist ,
profvis
should work fine withrhino
. The error you have posted suggests, that there is a problem withbox
/rhino
versions.purge_cache
has been introduced inbox
1.1.3 and is used inrhino
>= 1.4.0. Make sure that you use the same environment when you run your profiling. When it comes toprofvis_ui
- can you provide a minimal example of a code that does not work? You can also check this -profvis_ui
example translated torhino
: