COHHIO / Rminor

Shiny app for Ohio Balance of State CoC reporting
https://cohhio.github.io/Rminor/
GNU Affero General Public License v3.0
2 stars 3 forks source link

Computational optimization guidance: Results of timing and profiling server.R #34

Closed yogat3ch closed 1 year ago

yogat3ch commented 4 years ago

This PR should be able to be merged without conflict. Timings were taken of all major code blocks in server.R by stepping through each tab and each option in the running RMinor app with all possible selections (all regions). All timings were recorded for the code blocks and averaged. The selected code blocks, and the line numbers to which Rminortimings.png corresponds are represented in server_profile.R.

Each of the code blocks implicated in Rminortimings.png were then profiled to better understand why these code blocks took more time than others. These Rprof files are included in profvis/server_prof and can be viewed with profvis::profvis.

The major finding is that the _between functions seem to be consuming the majority of the computation time, and largely due to the calls to lubridate and as.Date functions. Recommendation: Ensure that the columns currently being coerced to date formats within the call to _between are instead coerced in COHHIO_HMIS prior to app load. That way filtering between becomes a simple filter operation.

Rminortimings.png: