Return to
HomePage
Performance Guidelines: .NET Framework 2.0
Summary
This module provides design and coding techniques for optimizing and improving the performance of your managed code (.NET Framework 2.0). This chapter will help you develop managed code that takes full advantage of the high performance offered by the common language runtime. Key topics covered in this chapter include class design considerations, memory management and garbage collection issues, when and how to pin memory, developing efficient multithreaded code, using effective asynchronous execution, boxing considerations, string manipulation, exception management, arrays, collections, precompiling code with Ngen.exe, and much more.
Applies To
* .NET Framework 2.0
Contents
* Objectives
* Overview
* How to Use This Module
* Architecture
* Performance and Scalability Issues
* Design Considerations
* Class Design Considerations
* Implementation Considerations
* Garbage Collection Explained
* Garbage Collection Guidelines
* Finalize and Dispose Explained
* Dispose Pattern
* Finalize and Dispose Guidelines
* Pinning
* Threading Explained
* Threading Guidelines
* Asynchronous Calls Explained
* Asynchronous Guidelines
* Locking and Synchronization Explained
* Locking and Synchronization Guidelines
* Value Types and Reference Types
* Boxing and Unboxing Explained
* Boxing and Unboxing Guidelines
* Exception Management
* Iterating and Looping
* String Operations
* Arrays
* Collections Explained
* Collection Guidelines
* Collection Types
* Reflection and Late Binding
* Code Access Security
* Working Set Considerations
*
Ngen.exe Explained * Ngen.exe Guidelines
* Summary
* Additional Resources
Ngen.exe Guidelines
This section summarizes recommendations if you are considering using Ngen.exe:
*
Scenarios where startup time is paramount should consider Ngen.exe for their startup path. *
Scenarios which will benefit from the ability to share assemblies should adopt Ngen.exe. *
Scenarios with limited or no sharing should not use Ngen.exe. *
Do not use Ngen.exe for ASP.NET version 1.0 and 1.1. *
Consider Ngen.exe for ASP.NET version 2.0. *
Measure performance with and without Ngen.exe. *
Regenerate your image when you ship new versions. *
Choose an appropriate base address.
Return to
HomePage