Contents
Chapter 1: Performance Metrics
Chapter 2: Performance Measurement
Approaches to Performance Measurement
Event Tracing for Windows (ETW)
Visual Studio Sampling Profiler
Visual Studio Instrumentation Profiler
Advanced Uses of Time Profilers
Visual Studio Allocation Profiler
Database and Data Access Profilers
Semantic Differences between Reference Types and Value Types
Storage, Allocation, and Deallocation
Invoking Methods on Reference Type Instances
Sync Blocks And The lock Keyword
Virtual Methods on Value Types
Avoiding Boxing on Value Types with the Equals Method
Best Practices for Using Value Types
Reference-Counting Garbage Collection
Pausing Threads for Garbage Collection
Generational Model Assumptions
.NET Implementation of Generations
References between Generations
GC Segments and Virtual Memory
Manual Deterministic Finalization
Automatic Non-Deterministic Finalization
Pitfalls of Non-Deterministic Finalization
Interacting with the Garbage Collector
Interacting with the GC using CLR Hosting
Garbage Collection Performance Best Practices
Miscellaneous Tips and Best Practices
Chapter 5: Collections and Generics
Implementation of CLR Generics
Chapter 6: Concurrency and Parallelism
Why Concurrency and Parallelism?
From Threads to Thread Pool to Tasks
Windows Synchronization Mechanisms
Chapter 7: Networking, I/O, and Serialization
Synchronous and Asynchronous I/O
Data Serialization and Deserialization
Windows Communication Foundation
Asynchronous WCF Clients and Servers
Chapter 8: Unsafe Code and Interoperability
PInvoke.net and P/Invoke Interop Assistant
Marshaling Direction, Value and Reference Types
TLB Import and Code Access Security
Chapter 9: Algorithm Optimization
Turing Machines and Complexity Classes
Memoization and Dynamic Programming
Chapter 10: Performance Patterns
Pre-JIT Compilation with NGen (Native Image Generator)
Multi-Core Background JIT Compilation
Managed Profile-Guided Optimization (MPGO)
Miscellaneous Tips for Startup Performance
Processor-Specific Optimization
Single Instruction Multiple Data (SIMD)
Generating Code Using Dynamic Lightweight Code Generation
Chapter 11: Web Application Performance
Testing the Performance of Web Applications
Visual Studio Web Performance Test and Load Test
Improving Web Performance on the Server
Using Asynchronous Pages, Modules, and Controllers
Tweaking the ASP.NET Environment
Turn Off ASP.NET Tracing and Debugging
Pre-Compiling ASP.NET Applications
Fine-Tuning the ASP.NET Process Model
Application Pool Configuration