#CodePerformance
Logging is one of the easiest ways to destroy performance without realizing it. Hidden allocations, unnecessary string formatting, and bad patterns add up fast.
If your app logs heavily, you need to read this. 👇
#dotnet #dotnet10 #CodePerformance #MVPBuzz
dotnettips.wordpress.com/2024/03/20/g...
General Performance Tip: Enhanced Logging Approach
The article discusses advancements in logging techniques in .NET, particularly with the new source generator in .NET 6 that enhances performance using LoggerMessage. This new method improves loggin…
dotnettips.wordpress.com
September 17, 2026 at 2:49 PM
⚡️ Just dropped the 5th edition of Rock Your Code: Code & App Performance for Microsoft .NET — the ultimate performance riff for modern .NET devs. Real benchmarks, real speed, real power. Ready to make your code scream? 🤘📈 🔗
#dotnet10 #MVPBuzz #CodePerformance
dotnettips.wordpress.com/2026/01/01/r...
Rock Your Code: Code & App Performance for Microsoft .NET (5th Edition)
The fifth edition of David McCarter’s book, “Röck Yöur Cöde: Code & App Performance for Microsoft .NET,” is now available on Amazon. It offers practical techniques for enhanci…
dotnettips.wordpress.com
September 16, 2026 at 3:04 PM
There’s more than one way to grab the first, last, or count from a collection—LINQ (First(), Last(), Count()) or direct indexing. LINQ reads nicer… but does it pay a performance tax? 👀
Find out here 👇
#dotnet10 #MVPBuzz #CA1826 #CodePerformance
dotnettips.wordpress.com/2024/01/25/c...
Collection Performance: Finding First or Last and Count
Many developers use LINQ methods such as First(), Last(), and Count() to interact with collections. However, these methods can be about 2.33× slower in performance compared to direct indexing. Caut…
dotnettips.wordpress.com
September 15, 2026 at 5:33 PM
🚀 Boost your .NET 10 projects with faster, allocation-free byte array conversions! Learn how to write cleaner, high-performance code for real-time data and binary processing.
#dotnet #dotnet10 #CodePerformance #RockYourCode
dotnettips.wordpress.com/2025/09/07/b...
Boost Your .NET Projects: Efficient Byte Array Conversions
When working with byte arrays in performance-critical applications, every nanosecond and allocation counts. Fortunately, in .NET, there is a class that provides several high-performance methods tha…
dotnettips.wordpress.com
September 14, 2026 at 3:04 PM
Think AnyAsync() is always faster than CountAsync()? Think again. 🚀 Benchmark results for CA1828 in .NET may surprise you! Learn when CountAsync() outperforms AnyAsync() and how to adjust your code for optimal performance.
dotnettips.wordpress.com/2025/03/12/m...
#dotNET #CodePerformance #MVPBuzz
Microsoft .NET Code Analysis: When CountAsync() Outperforms AnyAsync() in .NET
The article critiques code analysis rule CA1828 in Microsoft .NET, which suggests using AnyAsync() over CountAsync() for checking item existence in IQueryable collections. Benchmark results indicat…
dotnettips.wordpress.com
September 11, 2026 at 3:33 PM
There are several ways to get a string’s character count in .NET… but they don’t all perform the same. Span, Length, LINQ—each tells a different story. 👀
See which approach comes out on top 👇
#dotnet10 #MVPBuzz #CodePerformance
dotnettips.wordpress.com/2021/09/22/s...
String Performance: The Fastest Way to Get a String’s Length
The article highlights the importance of using efficient methods for checking if a string is empty or null, emphasizing the performance benefits and exception prevention of using `string.IsNullOrEm…
dotnettips.wordpress.com
September 10, 2026 at 3:52 PM
There are several approaches to creating objects in .NET. Curious about the most performant method? Discover the answer in this article.
dotnettips.wordpress.com/2024/03/06/g...
#dotnet #CodePerformance #MVPBuzz
General Performance Tip: Creating an Object
The author explores various object creation methods in .NET, highlighting performance differences. While the conventional “new” keyword proves to be the most efficient, other approaches…
dotnettips.wordpress.com
September 3, 2026 at 3:45 PM
New performance article for .NET engineers: Range expressions make collection slicing clean and readable, but are they the right choice for hot paths?
Learn what to consider when slicing with Span, Memory, and ReadOnlySpan.
dotnettips.com/2026/08/30/c...
#MVPBuzz #dotnet #codeperformance
Collection Performance: Use Caution when using Range Expressions in Hot Paths when Collection Slicing
Range expressions make collection slicing concise, but they can introduce unexpected overhead in hot paths. This subscriber-only article compares several ways to create slices with `Memory`, `Span`…
dotnettips.com
September 2, 2026 at 4:15 PM
In .NET, returning default, null, or an empty collection is not just style; it can hit performance too.

Don’t let sloppy returns trash your encore. Read this and rock your code!

#dotnet #MVPBuzz #CodePerformance
dotnettips.com/2024/04/08/g...
General Performance: Optimizing Method Returns
Modern best practices in method design emphasize returning empty collections instead of null values when no items are found, enhancing code safety and clarity.
dotnettips.com
August 28, 2026 at 3:20 PM
🎸 Don’t let your dictionary adds turn into performance feedback squeals!
Master the right patterns for adding items in .NET collections and keep your code tight and screaming with speed.
Rock the performance 👇
#dotnet #dotnet10 #MVPBuzz #CodePerformance
dotnettips.wordpress.com/2024/01/19/c...
Collection Performance: Adding Items To a Dictionary
The excerpt from “Rock Your Code” discusses two methods for adding items to a Dictionary in .NET: Add() and TryAdd().
dotnettips.wordpress.com
August 20, 2026 at 3:03 PM
Discover the efficiency of expression-bodied methods vs. traditional methods in .NET! 💻🔍 Learn more about their syntax and performance in this insightful article.
#dotnet #MVPBuzz #CodePerformance #dotnet
dotnettips.wordpress.com/2024/05/21/c...
Code It Any Way You Want: Expression-Bodied Methods vs. Traditional Methods
The article discusses the use of expression-bodied methods in .NET as an alternative to traditional methods for creating simple functions. It presents a comparison between the two methods in terms …
dotnettips.wordpress.com
August 19, 2026 at 3:11 PM
Discover the surprising truth about the performance of static vs. non-static methods in coding! 🔍📊 Check out the insightful findings and implications here. dotnettips.wordpress.com/2024/05/16/c...
#dotnet10 #MVPBuzz #CodePerformance #dotnet
Code It Any Way You Want: Performance Difference Between Static and Non-Static Methods
Most code analysis tools advocate for static methods due to perceived performance benefits. However, benchmarks indicate that non-static methods often outperform static ones despite avoiding instan…
dotnettips.wordpress.com
August 17, 2026 at 4:06 PM
Mastering substring extraction in C# with slicing! 🚀 Learn how to efficiently obtain substrings using the slice technique or the AsSpan() method. Check out the article here: dotnettips.wordpress.com/2024/04/10/s...
#dotnet #dotnet10 #MVPBuzz #CodePerformance
String Performance: Optimizing String Substring Extraction – Slicing vs. AsSpan()
The content presents an alternative approach to obtaining a substring using slicing with ReadOnlySpan and AsSpan() methods.
dotnettips.wordpress.com
August 13, 2026 at 3:10 PM
Want faster hash code generation in .NET? Explore how RuntimeHelpers.GetHashCode() can boost your app's performance by up to 87x! Learn more and check out the new FastGetHashCode() method in Spargine. 🔥
dotnettips.wordpress.com/2024/09/08/o...
#dotnet #CodePerformance #MVPBuzz
Optimizing Hash Code Generation in .NET: A Performance Comparison
This article discusses the importance of hash codes in programming and optimization techniques in Microsoft .NET. It explores different methods for generating hash code.
dotnettips.wordpress.com
August 12, 2026 at 7:11 PM
⚡️ Just dropped the 5th edition of Rock Your Code: Code & App Performance for Microsoft .NET — the ultimate performance riff for modern .NET devs. Real benchmarks, real speed, real power. Ready to make your code scream? 🤘📈 🔗
#dotnet10 #MVPBuzz #CodePerformance
dotnettips.wordpress.com/2026/01/01/r...
Rock Your Code: Code & App Performance for Microsoft .NET (5th Edition)
The fifth edition of David McCarter’s book, “Röck Yöur Cöde: Code & App Performance for Microsoft .NET,” is now available on Amazon. It offers practical techniques for enhanci…
dotnettips.wordpress.com
August 12, 2026 at 3:45 PM
Are you still checking characters in strings the old way in .NET? 👀
There’s a smarter, cleaner approach that can make your code faster and more efficient.
Read the full breakdown here: 🔗
#dotnet #dotnet10 #MVPBuzz #CodePerformance
dotnettips.wordpress.com/2024/05/08/s...
String Performance: Checking for a Character
The article compares two methods of checking for the presence of a specific character in a string in C#.
dotnettips.wordpress.com
August 7, 2026 at 3:06 PM
String performance in .NET:
One tiny choice. Big runtime implications.
If you care about clean, fast code, you’ll want to read this.
#dotnet10 #CodePerformance #MVPBuzz
dotnettips.wordpress.com/2026/01/25/s...
String Performance: The Fastest Way to Get a String’s Length
Retrieving the character count of a string in .NET has various methods: using Span with Length, Length, or Enumerable.Count(). This article will prove which is the fastest method.
dotnettips.wordpress.com
July 27, 2026 at 4:30 PM
📈 Can pattern matching make your .NET code faster? This performance tip breaks it down with real examples — a must-read for devs!
#dotnet10 #MVPBuzz #CodePerformance
dotnettips.wordpress.com/2024/04/19/g...
General Performance Tip: Can Pattern Matching Improve Performance?
The article discusses the potential performance improvements gained by leveraging pattern matching in .NET. It contrasts a traditional method for rounding numbers with a more refined version employ…
dotnettips.wordpress.com
July 23, 2026 at 2:55 PM
Type conversion in .NET may look like a small riff but pick the wrong move and your performance can start playing flat.
I break down the common approaches, the safer options, and which one really brings the heat.
#dotnet #MVPBuzz #CodePerformance
dotnettips.com/2024/05/10/g...
General Performance: Type Conversion
In .NET programming, type conversion can be done using explicit casting, the “as” keyword, or the declaration pattern for improved safety and readability. The declaration pattern effici…
dotnettips.com
July 22, 2026 at 6:13 PM
If your .NET code relies on Substring(), this article could change how you think about string performance. ✨
Full explanation here.
#dotnet #dotnet10 #CodePerformance #MVPBuzz
dotnettips.wordpress.com/2024/01/22/s...
String Performance: Retrieving a Substring
The post discusses optimizing string concatenation in .NET by using the Span type, which significantly enhances performance and reduces memory allocation.
dotnettips.wordpress.com
July 22, 2026 at 6:11 PM
Not all Enum name retrieval methods riff at the same speed.
If you’re still using the usual approach without thinking about the cost, this one’s for you.
Turn it up here!
#dotnet #MVPBuzz #Enums #CodePerformance
dotnettips.com/2024/05/01/g...
General Performance: Optimizing Enum Value Name Retrieval
The article delves into the optimization of Enum value name retrieval in .NET, comparing three approaches. It demonstrates that one of these methods is 13.3 times more efficient, with no memory all…
dotnettips.com
July 21, 2026 at 3:29 PM
Random number generation should hit like a power chord, not drag like a weak soundcheck.
This .NET performance tip shows a faster way to get the job done.
#dotnet #MVPBuzz #CodePerformance
dotnettips.com/2024/03/27/g...
General Performance: Optimizing Random Number Generation
The .NET Random type generates random numbers effectively, but using RandomNumberGenerator is significantly more efficient, offering a 7.08× speed increase. Both methods allocate equal memory; howe…
dotnettips.com
July 21, 2026 at 3:28 PM
🚀 Boost your .NET code efficiency! Learn best practices for array allocation and improve performance with tips from the .NET team. Check it out!
#dotnet10 #MVPBuzz #CodePerformance #dotnet
dotnettips.wordpress.com/2025/03/05/m...
Microsoft .NET Code Analysis: Creating Empty Arrays
Arrays are popular in .NET for their efficiency. The .NET team recommends avoiding zero-length allocations, opting instead for Array.Empty() or using the [] expression for creating empty arrays. Th…
dotnettips.wordpress.com
July 15, 2026 at 2:48 PM
Count vs IsEmpty can be the difference between fast code and a performance disaster.
For some immutable and concurrent collections, the wrong choice is tens of thousands of times slower.
#dotnet10 #dotnet #MVPBuzz #CodePerformance
dotnettips.wordpress.com/2026/04/12/c...
Collection Performance: High-Performance Emptiness Checks for Concurrent & Immutable Collections
Count vs IsEmpty can be the difference between fast code and a performance disaster. For some immutable and concurrent collections, the wrong choice is tens of thousands of times slower.
dotnettips.wordpress.com
July 14, 2026 at 3:03 PM
Still using Substring() + + for string concatenation?
There’s a faster, allocation-free way with Span.
Benchmarks show a 43× performance boost.
Read on 👇
#MVPBuzz #dotnet10 #CodePerformance
dotnettips.wordpress.com/2026/01/04/l...
Leveraging Span-Based String Concatenation for Improved Performance
The excerpt from “Rock Your Code” emphasizes the importance of efficient string concatenation in .NET. It highlights the advantages of using the Span type over traditional methods, demo…
dotnettips.wordpress.com
July 9, 2026 at 3:04 PM