Comments (5)
Based on the benchmark tests documented here, I replaced all %>% with |>. The loading is visually faster.
from opho-cdr-shiny.
Attempted methods to speed up dashboard and their outcomes:
- Subset data using dplyr instead of base R ( slight improvement)
- Adding bindCache() and bindEvent() (no difference)
- Using memoise on helper functions ( slows down app even more..??)
- Profiling the app using profvis ( difficult to translate into useful fixes)
- Eliminating renderUI elements ( moderate improvement)
- Only read in required data (slight improvement on startup)
- Close all other programs on computer and run only RStudio / Shiny App (biggest improvement)
from opho-cdr-shiny.
More on using caching in Shiny to maximize performance:
According to the article, caching, where the application does the computation with a given set of inputs once and uses the saved results later, is most effective when the same computation or plotting is done multiple times. However, we do not expect a user to repeat creating the same plot. Moreover, given that we have many possible combinations for the six filters (such as 6 choices for rate types, 25 diseases, 5 HAs, and 195 CHSAs), it will be memory-consuming if we cache every set of inputs the user plays with.
As a result, the tradeoff between time saved by caching outputs to rare sets of inputs and memory occupied by many set of inputs is not worthy for our app.
from opho-cdr-shiny.
We also tried using isolate() to remove the dependency of graph outputs on reactive objects based on this article.
Right now, our app is implemented in such a reactive way that the plots will be rerendered every time a filter value has changed. And since plotting does take a longer time, frequent changes to filter values will lead to slow performance and even cause the app to freeze.
Using isolate() can allow the user to finish all filter selections before clicking a button or other trigger to execute the computation and plotting all at once. However, this design is fundamentally different from what we tried to build and also requires significant changes to the existing code as the logic of reactive components changes. We decide to keep the responsiveness and let the users to leave buffer time between selections.
from opho-cdr-shiny.
Another suggested method is using promises with Shiny. This method is essentially applying asynchronous programming to Shiny apps to increase scalability when multiple users are active at the same time. Upon second thought, our goal is to increase performance for a single user. We do not anticipate many users to explore chronic diseases in BC simultaneously. So we did not research further. One can learn more here if scalability is the focus.
from opho-cdr-shiny.
Related Issues (19)
- Lets use common phrasing HOT 2
- Meeting Agenda for 2022-05-06
- Proposal Tasks HOT 1
- Draft Proposal development HOT 2
- Meeting Agenda for 2022-05-18 HOT 2
- Add missing topics HOT 2
- Meeting Agenda for 2022-05-27
- Meeting Agenda for 2022-06-03 HOT 1
- Meeting Agenda for 2022-06-09
- Joinpoint analysis regression : Data import and wrangling
- Joinpoint analysis regression : Preprocessing and Analysis
- Add project lifecycle badge HOT 1
- Meeting Agenda for 2022-06-17
- Final Project Report Comments
- It's Been a While Since This Repository has Been Updated
- Update README file contents and generation
- It's Been a While Since This Repository has Been Updated
- Capstone Week 1 Tasks HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opho-cdr-shiny.