24.10 Profiling
When optimizing a program, you also need to identify which parts of the code are ‘hot’ (frequently executed or resource-intensive). This is best accomplished via profiling, though it is a complex area and some tools only support certain operating systems. The Rust Performance Book provides an excellent overview of profiling techniques and tools.