cmu-delphi / cmu-delphi/epipredict
[Perf] Bottlenecks from profiling
- Dominant language
- R
- Stars
- 18
- Forks
- 13
- Avg merge
- 21d 58m
- Merged PRs (30d)
- 1
Description
Recent profiling [profvis_arduous.dingo_20240815.html.zip](https://github.com/user-attachments/files/16641071/profvis_arduous.dingo_20240815.html.zip) from exploration-tooling uncovered a couple slow spots in the code here:
- [ ] [this mold_recipe line that calls into a hardhat internal](https://github.com/cmu-delphi/epipredict/blob/319174292d4f9ec1b5590f305ec429b09d8e703f/R/blueprint-epi_recipe-default.R#L86)
- [x] and [this post-join error verification in layer_population scaling](https://github.com/cmu-delphi/epipredict/blob/319174292d4f9ec1b5590f305ec429b09d8e703f/R/layer_population_scaling.R#L143-L154), the slow line being the grepl after the join
I totally don't understand what's going on in (1), but @dsweber2 says @dajmcdon might rewrite that function at some point.
(2) seems like an incorrect use of try catch - the output of the try line is either an error or a tibble, but in either case it runs grepl on the result, which, in the latter case is quite slow. That should be a simple fix: catch the error and grepl only then.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.