.NET Performance and Debugging

1 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 5
Please Log in or register to rate

.NET Performance and Debugging


The .NET Performance and Debugging Workshop is a practical workshop for experienced .NET developers willing to develop high-performance .NET applications and debug them in the development and production environments.

In this eight-day workshop, you will obtain practical knowledge about the performance characteristics of the .NET framework and common language constructs; learn about the relevant internal details of the .NET type system, garbage collector and synchronization mechanisms; and practice debugging scenarios that arise in the development or production environment of .NET applications.

This workshop is limited to 8-12 participants to ensure that instructor attention is properly distributed during the practical labs, and to provide an opportunity for specific questions to be brought up after classroom hours.


Target Audience:

  • This workshop is intended for experienced .NET developers with working knowledge of C#


  • Working knowledge of C# and the .NET Framework, including threading, synchronization mechanisms, application domains
  • Familiarity with the C++ programming language (preferred but not a must)
  • Familiarity with operating systems concepts: paging, virtual memory, processes and threads
  • Familiarity with computer organization concepts: CPU cache, registers, main memory
1. Performance Measurement
  • Performance measurement metrics – what can be measured?
  • Windows performance counters
  • CPU profilers – sampling and instrumentation
  • Memory allocation profiling
  • Memory leak profiling
  • Concurrency profiling
  • Event Tracing for Windows
  • Windows Performance Toolkit and PerfView
  • Micro-benchmarking
  • LAB: Measuring CPU time and wall-clock time
  • LAB: Profiling memory allocations
  • LAB: Diagnosing a memory leak
  • LAB: Profiling CPU cache misses
2. Type Internals
  • Differences between value types and reference types
  • Reference type memory layout – type object pointer, sync block index
  • Invoking virtual vs. non-virtual methods, the sealed modifier
  • Value type memory layout, boxing
  • Implementing value types correctly – Equals and GetHashCode
3. Garbage Collection
  • Reference counting vs. tracing GC
  • The managed heap and the next object pointer (NOP)
  • Mark and sweep GC model, GC roots
  • GC flavors – workstation GC, server GC
  • Thread suspension for GC
  • Pinning objects referenced by unmanaged code
  • Generations and inter-generation references
  • GC segments and virtual memory
  • Managed GC APIs
  • Finalization internals and deterministic finalization
  • Weak references
  • Best practices for interacting with the GC
4. Generics
  • Motivation and generic constraints
  • Implementation of generics at runtime
  • .NET generics compared to Java generics and C++ templates
5. Unsafe Code
  • The Marshal class, accessing unmanaged memory
  • Copying data from unmanaged structures
  • C# pointers, the unsafe keyword, pinned pointers
  • LAB: Implementing memory copy with unsafe code
  • LAB: Improving upon code-generation approaches
6. Collections
  • Comparing collections: computational complexity, space complexity, internal implementation
  • CPU cache considerations
  • Implementing custom collections
  • Implementing interfaces and working around inlining limitations
7. JIT Optimizations
  • JIT optimizations
  • NGEN – pre-runtime compilation
  • MPGO, auto-NGEN, background JIT
8. Exceptions and Dumps
  • Exception Handling
  • Debugging Symbols
  • Dump Files and Types
  • Generating Dumps
  • Automatic Dump Generation
  • Opening Dump Files
9. Introduction to WinDbg
  • Basic WinDbg Commands
  • Smart Breakpoints
  • WinDbg Scripts
  • WinDbg Extensions
  • LAB: Getting Acquainted with WinDbg
  • LAB: Capturing Crash Dumps (x3)
10. C++ Debugging Scenarios
  • Heap Corruptions
  • Stack Corruptions
  • Memory Leaks
  • Resource Leaks
  • Deadlocks
  • LAB: Memory Leak
  • LAB: Heap Corruption
  • LAB: Stack Corruption
  • LAB: Handle Leak
  • LAB: Invalid Handles
  • LAB: Deadlock (x2)
11. Debugging Tools
  • Performance Counters
  • Process Explorer
  • Process Monitor
  • Application Compatibility Toolkit
  • ETW and Xperf
  • GFlags
  • LAB: Profiling with Xperf
  • LAB: Process Monitor
  • LAB: Application Compatibility Toolkit
12. Debugging in Visual Studio
  • Visual Studio Windows
  • Breakpoints and Tracepoints
  • Data Breakpoints, Function Breakpoints
  • Threads
  • Parallel Stacks, Parallel Tasks
  • Static Code Analysis
  • LAB: Runtime Checks
13. SOS
  • Setting Smart Breakpoints
  • Analyzing Memory Leaks
  • Inspecting Objects
  • Inspecting Threads and Stacks
  • Advanced Commands
  • LAB: Getting Acquainted with SOS
  • LAB: Capturing Crash Dumps (x2)
  • LAB: Deadlock (x2)
  • LAB: Memory Leak (x4)
14. .NET Debugging Tools
  • Managed Debugging Assistants
  • IntelliTrace
  • Visual Studio Profiler
  • CLR Profiler
  • ANTS Memory Profiler
  • Assembly Loading Diagnostics
  • LAB: Fusion Diagnostics
  • LAB: IntelliTrace
15. Appendixes
  • Assembly Language Fundamentals
  • Interop Debugging
© Copyright - Skilit - Site by Dweb