Jump to ratings and reviews
Rate this book

Writing High-Performance .NET Code

Rate this book
Do you want your .NET code to have the absolute best performance it can? This book demystifies the CLR, teaching you how and why to write code with optimum performance. Learn critical lessons from a person who helped design and build one of the largest high-performance .NET systems in the world.

This book does not just teach you how the CLR works—it teaches you exactly what you need to do now to obtain the best performance today. It will expertly guide you through the nuts and bolts of extreme performance optimization in .NET, complete with in-depth examinations of CLR functionality, free tool recommendations and tutorials, useful anecdotes, and step-by-step guides to measure and improve performance.

Among the topics you will learn are how to:

-Choose what to measure and why
-Use many amazing tools, freely available, to solve problems quickly
-Understand the .NET garbage collector and its effect on your application
-Use effective coding patterns that lead to optimal garbage collection performance
-Diagnose common GC-related issues
-Reduce costs of JITting
-Use multiple threads sanely and effectively, avoiding synchronization problems
-Know which .NET features and APIs to use and which to avoid
-Use code generation to avoid performance problems
-Measure everything and expose hidden performance issues
-Instrument your program with performance counters and ETW events
-Use the latest and greatest .NET features
-Ensure your code can run on mobile devices without problems
-Build a performance-minded team

…and much more.

280 pages, Paperback

First published July 11, 2014

173 people are currently reading
355 people want to read

About the author

Ben Watson

5 books5 followers
Ben Watson has been a software engineer at Microsoft since 2008. On the Bing platform team, he has built one of the world’s leading .NET-based, high-performance server applications, handling high-volume, low-latency requests across tens of thousands of machines for millions of customers. In his spare time, he enjoys geocaching, books of all kinds, classical music, and spending time with his wife and children. He is the author of the books Writing High-Performance .NET Code and C# 4.0 How-To.

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
145 (49%)
4 stars
99 (34%)
3 stars
39 (13%)
2 stars
8 (2%)
1 star
0 (0%)
Displaying 1 - 6 of 6 reviews
Profile Image for Jon.
174 reviews7 followers
July 9, 2018
Great book with lots of good advice on how to get the most performance out of your .NET application. Usually performance isn't the first thing I'm thinking about for applications I write. But now when I write code I will definitely think about the performance considerations for the code I write. Although normally performance isn't that big of a problem since my applications don't need to serve hundreds of thousands of customers.
Profile Image for Gabriel Santos.
62 reviews12 followers
October 27, 2019
Essencial a todo programador C# que trabalhe com sistemas onde alcançar melhores níveis de performance seja primordial.
Profile Image for Sergey Ignatchenko.
Author 3 books9 followers
December 11, 2016
If considering the book as a collection of best performance-related practices - it is pretty good. You cannot go too wrong using its advice.

On the other hand, if considering it as a book with non-trivial insights - TBH, given the author's access to MS teams, I expected a bit more. Chapter 2 on GC is pretty good (kudos!) but the rest is not exactly inspiring. Also benchmarks are too few and far between (and counting asm instructions is not a substitute for benchmarks on modern CPUs where single instruction can get anywhere between less-than-1 and 100+ cycles).

Still, IMO qualifies as very solid 4 stars.
427 reviews5 followers
November 18, 2020
good stuff, nothing ground-breaking, but brings most of the performance related discussions under one roof (GC, JIT, ETW, etc)

some API suggestions aren't relevant anymore (with .net core / 5 performance improvements)
Displaying 1 - 6 of 6 reviews

Can't find what you're looking for?

Get help and learn more about the design.