O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning .NET High-performance Programming

Book Description

Learn everything you need to know about performance-oriented programming for the .NET Framework

  • Understand the term "performance" and its significance in designing applications
  • Dive deep into the internals of CLR, from memory management to the thread lifecycle
  • A step-by-step guide with a special focus on designing performance-oriented solutions to handle large datasets

In Detail

This book will help you understand what "programming for performance" means, and use effective coding patterns and techniques to optimize your .NET applications. You will begin by understanding what "high performance coding" means, and the different performance concerns. You will see how CLR works and get an understanding of concepts such as memory management, garbage collection, and thread life cycles. You will proceed to learn about the theoretical and practical concepts of PLINQ programming. You will also see what Big Data is, and how to architect a Big Data solution to manipulate large datasets. Finally, you will learn how to launch and analyze a profile session and execute tests against a code block or application for performance analysis.

By the end of this book, you will have a complete understanding of efficient programming using high-performance techniques, and will able to write highly optimized applications.

What You Will Learn

  • Understand the significance of high performance in applications
  • Identify different performance concerns for all the mainly used architectures and designs
  • Acquaint yourself with the commonly used MVC and MVVM patterns
  • Understand the fundamentals of CLR
  • Learn more about Task Parallel Library and concepts such as Thread Pool Tuning and parameter injection
  • Use PLINQ programming to achieve parallelism
  • Design Big Data solutions for handling datasets optimally
  • Choose high-performance querying strategies to retrieve and manipulate data
  • Execute tests on applications for performance analysis

Table of Contents

  1. Learning .NET High-performance Programming
    1. Table of Contents
    2. Learning .NET High-performance Programming
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
        3. Instant updates on new Packt books
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    8. 1. Performance Thoughts
      1. Understanding performance
      2. Performance as a requirement
      3. Performance engineering
      4. Performance aspects
        1. Latency
        2. Throughput
        3. Resource usage
        4. Availability/reliability
        5. Scalability
        6. Efficiency
      5. Class of applications
        1. Case study: performance aspects of a desktop application
        2. Case study: performance aspects of a mobile application
        3. Case study: performance aspects of a server application
        4. Performance concerns as time changes
      6. Technical overview
        1. Multithreaded programming
        2. Parallel programming
        3. Distributed computing
        4. Grid computing
      7. Summary
    9. 2. Architecting High-performance .NET Code
      1. Software architecture
      2. Performance concerns about architecture
      3. Object-oriented design principles
        1. The single responsibility principle
        2. The open-closed principle
        3. The Liskov substitution principle
        4. The interface segregation principle
        5. The dependency inversion principle
      4. Common designs and architectures
        1. Layered architecture
          1. Performance concerns
        2. Model-View-Controller and ASP.NET MVC
          1. Performance concerns
        3. Model-View-ViewModel and XAML
          1. Performance concerns
        4. The 3-tier architecture
          1. Performance concerns
        5. Service-Oriented Architecture (SOA)
          1. Standardized service contract
          2. Service loose coupling
          3. Service abstraction
          4. Service reusability
          5. Service autonomy
          6. Service statelessness
          7. Service discoverability
          8. Service composability
          9. Performance concerns
      5. Architecture comparison
      6. Common platform architectures
        1. Architecting desktop applications
        2. Architecting mobile applications
        3. Architecting web applications
        4. Architecting cloud web applications
      7. Performance considerations
        1. Caching, when and where
        2. PLINQ everywhere
        3. Inversion of Control (IoC)
        4. Lazy loading
        5. Reusability of code
        6. Agnostic versus idiom-powered implementation
        7. Short coding
        8. Remote computation
        9. Cloud versus on-premise applications
      8. Summary
    10. 3. CLR Internals
      1. Introduction to CLR
      2. Memory management
      3. Garbage collection
        1. Large object heap
        2. Collection tuning
      4. Working with AppDomains
        1. IDisposable interface
      5. Threading
      6. Multithreading synchronization
        1. Locks
        2. Signaling locks
        3. Drawbacks of locks
      7. Exception handling
      8. Summary
    11. 4. Asynchronous Programming
      1. Understanding asynchronous programming
      2. Asynchronous programming theory
      3. Asynchronous Programming Model (APM)
      4. Event-based Asynchronous Pattern (EAP)
      5. Task-based Asynchronous Pattern (TAP)
        1. Task creation
        2. Task synchronization
        3. Task exception handling
        4. Task cancellation
        5. Task continuation
        6. Task factories
      6. Task UI synchronization
      7. Async/await
      8. Summary
    12. 5. Programming for Parallelism
      1. Parallel programming
        1. Task parallelism
        2. Data parallelism
      2. Task parallelism with TPL
      3. Data parallelism with TPL
        1. ThreadPool tuning
        2. Parallel execution abortion
        3. Partitions
        4. Sliding parallel programming
      4. Integrated querying with LINQ
      5. Data parallelism with PLINQ
        1. Partitioning optimization
      6. Summary
    13. 6. Programming for Math and Engineering
      1. Introduction
      2. Evaluating the performance of data types
        1. BigInteger
        2. Half-precision data type
      3. Real-time applications
      4. Case study: Fourier transform
        1. Rolling average
        2. Low-pass filtering for Audio
      5. Sliding processing
      6. Summary
    14. 7. Database Querying
      1. Introduction
      2. Overview of ADO.NET
      3. An overview of Entity Framework
        1. Advanced querying
      4. Entity Framework querying optimization
        1. Querying execution lifecycle
        2. Querying approaches
          1. Performance thoughts
      5. Entity Framework persistence optimization
      6. Performance comparison
        1. Stream-like querying
      7. ADO.NET bulk copy
      8. Summary
    15. 8. Programming for Big Data
      1. What is big data?
      2. Architecting big data solutions
        1. Case study – automotive big data system
      3. Microsoft Azure for big data
        1. Service Bus Topic
        2. AppFabric Cache
        3. Redis Cache
      4. Simplified grid computing
      5. Lookup programming
      6. Summary
    16. 9. Analyzing Code Performance
      1. Software profiling
      2. Profiling with Visual Studio
        1. Instrumentation profiling
        2. The analysis report comparison
      3. Testing with Visual Studio 2013
        1. The Integration test
        2. Performance-related tests
        3. TDD
        4. Test and Continuous Integration
      4. Static program analysis
        1. Code analysis
        2. Code metrics
      5. Summary
    17. Index