PerformanceMake The Developers Feel The Pain
Do you care about perfromance? Do you want to avoid that last three weeks of intesive performance work that require you to break apart a beautiful domain model and cut wide swathes of optimization horrors into your code?
How to do this? Setup the system so it would fail if a given performance objective is passed. A simple example can be to add a check to the request finish that verify that the amount of database queries falls beneath a pre-defined threshold*. If the page is executing more than X queries, it fails, immediately, on the developer machine, with a clear signal saying why. Take this approach to the test / QA machines as well. Make sure that when a performance issue hits, it is something that can't be ignored, and it can be pointed directly to the developer responsible.
The only way to do this reliably is to fail as early as possible, which would force the developer to fix the issue on the spot, when it is still a single, isolated issue.
I can think of two or three very easy to measure stats that you can get:
- Number of queries per page.
- Number of remote calls (web service, remoting, etc) per page.
- Page processing time (only when debugger is not attached!).
I can't think of any way to assoicate CPU usage with the current request, otherwise I would have included that as well.
The rapid response cycle here has the same affect is here that it has when fixing bugs. Localized, immediate, fix is much faster / better than a global optimization stage later on.
* You do have a way to associate this data with the specific request, right?
More posts in "Performance" series:
- (10 Jan 2025) IOPS vs. IOPS
- (03 Jan 2025) Managed vs. Unmanaged memory
Comments
Comment preview