14-day free trial (download)
Try ANTS Profiler for free with our 14-day, fully functional evaluation.
ANTS Profiler™ – .NET tuning tool
The situation
Tuning your .NET application is primarily about speed, code quality and documentation. While all of these issues are important to consider throughout the development process, most people focus on them towards the end of a project.
Simplistically, we can consider the development of a .NET application to be a three stage process:
- Create the code that will allow you to implement the functionality you are trying to achieve.
- Test and debug the code, which will almost certainly involve several rewrites of the most challenging parts of your code.
- Tune your .NET application.
Although the order of this list is broadly correct, in reality most development flits between all three areas on a daily basis. However, in aggregate, development progresses with most activity in code creation initially, debug and test in the middle, and tuning at the end.
Key challenges
- Finding the code that is actually causing problems.
- Reducing the amount of time taken to find problem code.
- Assessing code and assemblies to ensure quality.
How we can solve it
At Red Gate we recommend the following approach to .NET tuning.
Speed
For tuning the speed of your .NET application, use Red Gate's ANTS Profiler. Generally, it makes sense to focus on the areas you identified in Stage 2, above. ANTS Profiler will help you understand which parts of your application are worth tuning, right down to the lines of code to tune. More detail about how to find slow lines of code with ANTS Profiler can be found on our product pages. Although you can, and should, use ANTS Profiler during the test and debugging phase, tuning is an important use for a profiler.
To find out more about tuning the speed of your .NET application using ANTS Profiler, please visit our ANTS Profiler product pages.
Code quality
.NET code quality is best assessed via a code review – where team members look at, and comment on, the actual code. However, before you put yourself through that, it is well worth using FXCop which " … is a code analysis tool that checks .NET managed code assemblies for conformance to the Microsoft .NET Framework Design Guidelines. It uses reflection, MSIL parsing, and callgraph analysis to inspect assemblies for more than 200 [code] defects." By checking for common problems automatically, your code review is more likely to focus on key issues rather than spelling mistakes.
Documentation
Although it is often said you should produce your documentation at the end, this makes for a whole load of additional, unnecessary work – essentially because Stage 2 often involves repeated rewriting, reordering and refactoring. We recommend doing the documentation while the code is still fresh in your mind. We've not found any automatic documentation tools that are worth using.
Benefits of our solution
- ANTS Profiler reduces the amount of time taken to find problem code by identifying the exact cause of any problem.
- No time is wasted tuning code that isn't the cause of any problem.
- Analyzing code prior to review helps focus on key issues.

