Measure twice, cut once
In order for us to begin understanding how we can improve our application’s performance, we must first know how it is performing and which resources are being utilized by the application. This can be summed up in the following quote:
This quote is attributed to many individuals (Lord Kelvin and Peter Drucker, to name two), but regardless of who said it, it captures the essence of how we should think about performance testing and analysis. Before we can make any reasonable assertion that we want to improve the performance of some code, we need to measure and understand what the code is doing and how resources are being utilized. Without this measurement step, we will have no true understanding of whether the work we have undertaken has improved the performance of our code or whether it has had no significant impact at all.
I have titled this section Measure twice, cut once, as this is another important...