For an R Shiny web app, what are some good ways to run code profiling that show the parts of the Shiny code that are taking the most processing time?
I\'ve got a bi
From my experiences:
mydebug <- function(msg="[DEBUG]") {
DEBUG <- FALSE
if (DEBUG) {
print(sprintf("%s - %s - %s", msg1, as.character(Sys.time()), as.character(deparse(sys.calls()[[sys.nframe()-1]]))))
}
}
f <- function() {
mydebug()
## your original function definitions .....
mydebug()
return(...) ## the returned value needs to be after mydebug()
}
You can obtain a flame to find out where the time spent (e.g., which JS function? Is it due to layout?).
For details, refer to: https://developers.google.com/web/tools/chrome-devtools/profile/rendering-tools/analyze-runtime?hl=en