Takeaways
Here’s what you learned during this profiling session:
-
Optimization with the profiler is a craft, not engineering.
You must look at the data, make your best guess at what’s slow, change the code, reprofile, and see whether your optimization worked. Rinse and repeat. The best way to learn this craft is by doing it. The more you profile, the better you understand the results you get, and the better optimization guesses you make.
-
Write tests before profiling.
You’ll change the code a lot during profiling. Tests are your only way to ensure the program still does what it’s supposed to do.
-
The profiler will tell you what to optimize or where to concentrate your optimization effort.
In our profiling session example, the profiler ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access