Pro .NET Performance

Book description

Maximizing the performance of your algorithms and applications is extremely important and can give you a competitive advantage, a lower cost of ownership, and happier users. Pro .NET Performance explains the internals of Windows, the CLR, and the physical hardware that affect the performance of your applications, and gives you the knowledge and tools to measure how your code performs in isolation from external factors.

The book is full of C# code samples and tips to help you squeeze every bit of juice from your application—lower memory utilization, consistent CPU usage, and fewer I/O operations across the network and disk. Pro .NET Performance will change the way you think about .NET application development.

  • Guides you through performance measurement with a variety of profilers and other tools

  • Explains how OS and CLR internals affect your application's performance in unexpected ways

  • Provides you with tips and real-life case studies for improving application performance

  • What you'll learn

  • Measure your code's performance with profilers and other tools.

  • Understand where the bottlenecks are and focus on the right area for performance improvement.

  • Manage memory efficiently by interacting properly with the garbage collector.

  • Avoid common pitfalls by choosing the right abstractions.

  • Understand the performance implications of the underlying operating system and runtime.

  • Improve the performance of your applications by parallelization, caching, micro-optimization, and other techniques.

  • Who this book is for

    Pro .NET Performance is for working .NET developers who care about the performance of their applications. It requires basic familiarity with Windows and the CLR, but guides the reader along the way and does not require prior experience with any performance-measurement tools. Pro .NET Performance also offers practical tips, case studies, and low-level knowledge for experienced developers and architects.

    Table of contents

    1. Title
    2. Dedication
    3. Contents at a Glance
    4. Contents
    5. Foreword
    6. About the Authors
    7. About the Technical Reviewers
    8. Acknowledgments
    9. Introduction
    10. Chapter 1: Performance Metrics
      1. Performance Goals
      2. Performance Metrics
      3. Summary
    11. Chapter 2: Performance Measurement
      1. Approaches to Performance Measurement
      2. Built-in Windows Tools
      3. Time Profilers
      4. Allocation Profilers
      5. Memory Profilers
      6. Other Profilers
      7. Microbenchmarking
      8. Summary
    12. Chapter 3: Type Internals
      1. An Example
      2. Semantic Differences between Reference Types and Value Types
      3. Storage, Allocation, and Deallocation
      4. Reference Type Internals
      5. Value Type Internals
      6. Best Practices for Using Value Types
      7. Summary
    13. Chapter 4: Garbage Collection
      1. Why Garbage Collection?
      2. Tracing Garbage Collection
      3. Garbage Collection Flavors
      4. Generations
      5. GC Segments and Virtual Memory
      6. Finalization
      7. Weak References
      8. Interacting with the Garbage Collector
      9. Garbage Collection Performance Best Practices
      10. Summary
    14. Chapter 5: Collections and Generics
      1. Generics
      2. Collections
      3. Custom Collections
      4. Summary
    15. Chapter 6: Concurrency and Parallelism
      1. Challenges and Gains
      2. From Threads to Thread Pool to Tasks
      3. Synchronization
      4. General Purpose GPU Computing
      5. Summary
    16. Chapter 7: Networking, I/O, and Serialization
      1. General I/O Concepts
      2. Scatter–Gather I/O
      3. File I/O
      4. Networking
      5. Data Serialization and Deserialization
      6. Windows Communication Foundation
      7. Summary
    17. Chapter 8: Unsafe Code and Interoperability
      1. Unsafe Code
      2. P/Invoke
      3. COM Interoperability
      4. C++/CLI Language Extensions
      5. Windows 8 WinRT Interop
      6. Best Practices for Interop
      7. Summary
    18. Chapter 9: Algorithm Optimization
      1. Taxonomy of Complexity
      2. Memoization and Dynamic Programming
      3. Approximation
      4. Probabilistic Algorithms
      5. Indexing and Compression
      6. Summary
    19. Chapter 10: Performance Patterns
      1. JIT Compiler Optimizations
      2. Startup Performance
      3. Processor-Specific Optimization
      4. Exceptions
      5. Reflection
      6. Code Generation
      7. Summary
    20. Chapter 11: Web Application Performance
      1. Testing the Performance of Web Applications
      2. Improving Web Performance on the Server
      3. Tweaking the ASP.NET Environment
      4. Configuring IIS
      5. Optimizing the Network
      6. Scaling ASP.NET Applications
      7. Summary
    21. Index

    Product information

    • Title: Pro .NET Performance
    • Author(s): Sasha Goldshtein, Dima Zurbalev, Ido Flatow
    • Release date: September 2012
    • Publisher(s): Apress
    • ISBN: 9781430244585