Jump to ratings and reviews
Rate this book

High-Performance Programming in C# and .NET: Understand the nuts and bolts of developing robust, faster, and resilient applications in C# 10.0 and .NET 6

Rate this book
Enhance your applications' performance using best practices for benchmarking, application profiling, asynchronous programming, designing responsive UIs, gRPC communication, and distributed applications

Key FeaturesMake the best use of performance enhancements in C# 10.0 and .NET 6Boost application performance by identifying hardware bottlenecks and common performance pitfallsGet to grips with best practices and techniques for improving the scalability of distributed systemsBook DescriptionWriting high-performance code while building an application is crucial, and over the years, Microsoft has focused on delivering various performance-related improvements within the .NET ecosystem. This book will help you understand the aspects involved in designing responsive, resilient, and high-performance applications with the new version of C# and .NET.

You will start by understanding the foundation of high-performance code and the latest performance-related improvements in C# 10.0 and .NET 6. Next, you’ll learn how to use tracing and diagnostics to track down performance issues and the cause of memory leaks. The chapters that follow then show you how to enhance the performance of your networked applications and various ways to improve directory tasks, file tasks, and more. Later, you’ll go on to improve data querying performance and write responsive user interfaces. You’ll also discover how you can use cloud providers such as Microsoft Azure to build scalable distributed solutions. Finally, you’ll explore various ways to process code synchronously, asynchronously, and in parallel to reduce the time it takes to process a series of tasks.

By the end of this C# programming book, you’ll have the confidence you need to build highly resilient, high-performance applications that meet your customer's demands.

What you will learnUse correct types and collections to enhance application performanceProfile, benchmark, and identify performance issues with the codebaseExplore how to best perform queries on LINQ to improve an application's performanceEffectively utilize a number of CPUs and cores through asynchronous programmingBuild responsive user interfaces with WinForms, WPF, MAUI, and WinUIBenchmark ADO.NET, Entity Framework Core, and Dapper for data accessImplement CQRS and event sourcing and build and deploy microservicesWho this book is forThis book is for software engineers, professional software developers, performance engineers, and application profilers looking to improve the speed of their code or take their skills to the next level to gain a competitive advantage. You should be a proficient C# programmer who can already put the language to good use and is also comfortable using Microsoft Visual Studio 2022.

Table of ContentsIntroducing C# 10.0 and .NET 6Implementing C# InteroperabilityPredefined Data Types and Memory AllocationsMemory ManagementApplication Profiling and TracingThe .NET CollectionsLINQ PerformanceFile and Stream I/OEnhancing the Performance of Networked ApplicationsSetting Up Our Database ProjectBenchmarking Relational Data Access FrameworksResponsive User InterfacesDistributed SystemsMulti-Threaded Programming&

660 pages, Kindle Edition

Published July 29, 2022

7 people are currently reading
4 people want to read

About the author

Jason Alls

5 books

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
0 (0%)
4 stars
0 (0%)
3 stars
2 (66%)
2 stars
0 (0%)
1 star
1 (33%)
Displaying 1 - 2 of 2 reviews
Profile Image for Michael Tsai.
22 reviews1 follower
September 12, 2022
There is a problem in this book. In Chapter 6: .NET Collections, section title "Exploring the yield keyword" the author made a mistake that could mislead readers.
The author compare performance with the following two methods:

public IEnumerable GetValues()
{
    List list = new List();
    for (long i = 0; i < 1000000; i++)
        list.Add(i);
    return list;
}

public IEnumerable GetValuesYield()
{
    for (long i = 0; i < 1000000; i++)
        yield return i;
}

Using the following benchmark code:

[Benchmark]
public void GetValuesBenchmark()
{
    var data = GetValues();
}

[Benchmark]
public void GetValuesYieldBenchmark()
{
    var data = GetValuesYield();
}

The benchmark result shows GetValuesYield is 903,628.26 times faster than GetValues method, then the author tells readers "So, you can see that the use of the yield keyword is very beneficial to the performance of your computer programs." Then he closed this section without any further explanation. Wait! That's not the end of the story. The author's conclusion is misleading because he is comparing different things.
In the GetValuesYieldBenchmark method, it shoud force the whole process of yield be executed, for example convert IEnumerable to List. Then it can be compared with GetValuesBenchmark method.
Profile Image for Rene Stein.
232 reviews36 followers
January 11, 2023
Incredible piece of shit. Misleading, wrong, unrelated, blindly copied information from other sources. Shameless robbery. Thanks God I have paid only 5 USD for the ebook.
Displaying 1 - 2 of 2 reviews

Can't find what you're looking for?

Get help and learn more about the design.