20
Jun
Imagine you have a solution to a problem or a task, and now you need to evaluate the optimality of this solution from a performance perspective. The most obvious way is to use StopWatch like this: However, there are several issues with this method: It is quite an inaccurate method, since the code being evaluated is executed only once, and the execution time can be affected by various side effects such as hard disk performance, not warmed-up cache, processor context switching, and other applications. It does allow you to test the application in Production mode. During compilation, a significant part…