Following are some of the rules from fxcop to identify performance related issues in your modules.
- Avoid costly calls where possible
- Avoid calls that require unboxing
- Avoid excessive locals
- Avoid uncalled private code
- Avoid uninstantiated internal classes
- Avoid unnecessary string creation
- Avoid unsealed attributes
- Avoid unused parameters
- Dispose methods should call SuppressFinalize
- Do not call properties that clone values in loops
- Do not cast unnecessarily
- Do not concatenate strings inside loops
- Do not ignore method results
- Do not initialize unnecessarily
- Initialize reference type static fields inline
- Override equals and operator equals on value types
- Prefer jagged arrays over multidimensional
- Properties should not return arrays
- Remove empty finalizers
- Remove unused locals
- Test for empty strings using string length
- Use literals where appropriate
MS FxCop can be used to identify your application performance related problems with the above rules from its rule engine.
The description and sample code of each rule is available in FxCop documentation.
No comments:
Post a Comment