Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App loads slowly #46

Open
patwater opened this issue Jan 26, 2017 · 1 comment
Open

App loads slowly #46

patwater opened this issue Jan 26, 2017 · 1 comment

Comments

@patwater
Copy link

@christophertull @anudeepvanjavakam1 no urgent though would be good go through the code and see how we might speed up load times -- currently pretty slow. Part of that might be due to the transition to the analytics portal (@christophertull thoughts?)

See here for one method of analysis to profile the code itself: http://rstudio.github.io/profvis/examples.html#example-3---profiling-a-shiny-application

There might also need to be some thinking in terms of the server configuration though that's bumping up against the limits of my knowledge :P

Another option if we need to deploy this for a large number of agencies might be to get an RStudio Server account -- not sure how that would affect speed though

@christophertull
Copy link
Member

Good points Patrick! I have a few ideas for likely speedups, in order of ease of implementation:

  1. Saving the dataset as a .rda file instead of a CSV should speed up the initial load time.

  2. Drew's recommendation to not calculate hypothetical revenue for historical data (only for forecasts) would speed up normal operation because it would put less load on RateParser.

  3. There is probably some room for parallelization in RateParser. E.g. could chunk up the dataframe and dispatch to different cores.

  4. Right now RateParser is called more times than it needs to be. This is a result of Shiny's reactive nature and the feedback between the OWRS file and the inputs. If we could only call RateParser once instead of ~3 times when the tab is first loaded we would see a bit speed boost. Tracking things through the chain of reactivity can be a nightmare though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants