Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Writing High-Performance .NET Code
Writing High-Performance .NET Code
About the Author
Acknowledgements
Foreword
Introduction to the Second Edition
Introduction
Purpose of this Book
Why Should You Choose Managed Code?
Is Managed Code Slower Than Native Code?
Are The Costs Worth the Benefits?
Am I Giving Up Control?
Work With the CLR, Not Against It
Layers of Optimization
The Seductiveness of Simplicity
.NET Performance Improvements Over Time
.NET Core
Sample Source Code
Why Gears?
Performance Measurement and Tools
Choosing What to Measure
Premature Optimization
Average vs. Percentiles
Benchmarking
Useful Tools
Measurement Overhead
Summary
Memory Management
Memory Allocation
Garbage Collection Operation
Configuration Options
Performance Tips
Investigating Memory and GC
Summary
JIT Compilation
Benefits of JIT Compilation
JIT in Action
JIT Optimizations
Reducing JIT and Startup Time
Optimizing JITting with Profiling (Multicore JIT)
When to Use NGEN
.NET Native
Custom Warmup
When JIT Cannot Compete
Investigating JIT Behavior
Summary
Asynchronous Programming
The Thread Pool
The Task Parallel Library
TPL Dataflow
Parallel Loops
Performance Tips
Thread Synchronization and Locks
Investigating Threads and Contention
Summary
General Coding and Class Design
Classes and Structs
Tuples
Interface Dispatch
Avoid Boxing
ref returns and locals
for vs. foreach
Casting
P/Invoke
Delegates
Exceptions
dynamic
Reflection
Code Generation
Preprocessing
Investigating Performance Issues
Summary
Using the .NET Framework
Understand Every API You Call
Multiple APIs for the Same Thing
Collections
Strings
Avoid APIs that Throw Exceptions Under Normal Circumstances
Avoid APIs That Allocate From the Large Object Heap
Use Lazy Initialization
The Surprisingly High Cost of Enums
Tracking Time
Regular Expressions
LINQ
Reading and Writing Files
Optimizing HTTP Settings and Network Communication
SIMD
Investigating Performance Issues
Summary
Performance Counters
Consuming Existing Counters
Creating a Custom Counter
Summary
ETW Events
Defining Events
Consume Custom Events in PerfView
Create a Custom ETW Event Listener
Get Detailed EventSource Data
Consuming CLR and System Events
Custom PerfView Analysis Extension
Summary
Code Safety and Analysis
Understanding the OS, APIs, and Hardware
Restrict API Usage in Certain Areas of Your Code
Centralize and Abstract Performance-Sensitive and Difficult Code
Isolate Unmanaged and Unsafe Code
Prefer Code Clarity to Performance Until Proven Otherwise
Summary
Building a Performance-Minded Team
Understand the Areas of Critical Performance
Effective Testing
Performance Infrastructure and Automation
Believe Only Numbers
Effective Code Reviews
Education
Summary
Kick-Start Your Application’s Performance
Define Metrics
Analyze CPU Usage
Analyze Memory Usage
Analyze JIT
Analyze Asynchronous Performance
Higher-Level Performance
ASP.NET
ADO.NET
WPF
Big O
Common Algorithms and Their Complexity
Bibliography
Useful Resources
People and Blogs
Contact Information
← Prev
Back
Next →
← Prev
Back
Next →