8 Optimizing code for efficiency
8.1 Learning objectives
The overall learning outcome for this session is to:
- Describe some coding strategies to optimize code to reduce computing time and resource usage, identify situations to make use of them, and apply them within an R project.
Specific objectives are to:
Explain why a functional programming approach, by using functions and functionals (like functions from purrr), is one of the more efficient methods to working with large data.
Explain what parallel processing is and when it should be used to speed up code rather than slow it down.
Implement parallel processing for smaller chunks of code by using furrr and
{futures}
.Incorporate parallel processing within a targets pipeline by using crew, functionals, and functions.
Identify how the split-apply-combine approach can be applied to a server situation that will improve speed and reduce resources.
8.2 TODO: Section
8.3 Exercise: TODO: Add title
Time: ## minutes.
8.4 Summary
- TODO: List of summary items