Monday, August 14, 2006

Performance Rules from Microsoft FxCop 1.35

Performance Rules from Microsoft FxCop 1.35

Following are some of the rules from fxcop to identify performance related issues in your modules.


  1. Avoid costly calls where possible
  2. Avoid calls that require unboxing
  3. Avoid excessive locals
  4. Avoid uncalled private code
  5. Avoid uninstantiated internal classes
  6. Avoid unnecessary string creation
  7. Avoid unsealed attributes
  8. Avoid unused parameters
  9. Dispose methods should call SuppressFinalize
  10. Do not call properties that clone values in loops
  11. Do not cast unnecessarily
  12. Do not concatenate strings inside loops
  13. Do not ignore method results
  14. Do not initialize unnecessarily
  15. Initialize reference type static fields inline
  16. Override equals and operator equals on value types
  17. Prefer jagged arrays over multidimensional
  18. Properties should not return arrays
  19. Remove empty finalizers
  20. Remove unused locals
  21. Test for empty strings using string length
  22. 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:

    follow me on Twitter