#CodePerformance
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
November 6, 2026 at 3:49 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
October 29, 2026 at 8:13 AM
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
October 29, 2026 at 8:16 AM
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
October 26, 2026 at 8:24 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
October 23, 2026 at 8:02 AM
🚀 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
October 22, 2026 at 7:32 AM
Shuffling collections isn’t a toy problem. 🪀
In .NET 10, the wrong shuffle can quietly dominate your runtime.
I ran the benchmarks and analyzed the results.
#dotnet10 #MVPBuzz #Collections #CodePerformance
dotnettips.wordpress.com/2026/01/18/c...
Collection Performance: High-Performance Collection Randomization in .NET
The article examines shuffling options in .NET 8, highlighting the performance of three APIs: LINQ.Shuffle(), Random.Shuffle(), and RandomNumberGenerator.Shuffle().
dotnettips.wordpress.com
October 20, 2026 at 7:50 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
October 20, 2026 at 7:51 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
October 20, 2026 at 7:52 PM
Type checking in .NET: What’s best—`GetType()`, `is`, `as`, or `IsAssignableFrom()`? Each has trade-offs in readability and performance. Choose wisely! 🧐
dotnettips.wordpress.com/2025/04/06/c...
#dotNET #CodingTips #dotNetTips #MVPBuzz #CodePerformance
Comparing Type Checking Methods in .NET: Performance vs. Readability
In .NET, type checking methods include GetType(), the is keyword, IsAssignableFrom(), and the as keyword. Each method varies in readability and performance.
dotnettips.wordpress.com
October 14, 2026 at 3:11 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
October 13, 2026 at 8:23 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
October 8, 2026 at 8:32 PM
Surprising .NET performance gains? 🤯 Using custom comparers in sorting & LINQ can be over 4x faster—or 20x slower if done wrong! Discover benchmarks, pitfalls, and best practices to supercharge your apps. 🚀 Read more here.
dotnettips.wordpress.com/2025/03/02/u...
#dotnet #codeperformance #MVPBuzz
Unlock Performance Gains in .NET: The Power of Custom Comparers
This article highlights the importance of custom comparers in .NET for enhancing application performance when sorting and ordering collections. It discusses the flexibility and control that custom …
dotnettips.wordpress.com
October 6, 2026 at 7:43 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
October 5, 2026 at 3:12 PM
🚀 Don't make the same mistake! Learn from DotNetDave's story about the critical importance of addressing performance before product release. Read more here! dotnettips.wordpress.com/2024/04/04/d...
#CodePerformance #dotNetDaveStory #MVPBuzz #SoftwareDevelopment #SoftwareEngineering
dotNetDave Story: The Critical Importance of Addressing Performance Before Product Release
A true story illustrates the critical importance of addressing performance issues before a product launch. Despite warnings about potential negative impacts on customer experience, management dismi…
dotnettips.wordpress.com
October 2, 2026 at 3:11 PM
🔥 Stop playing air guitar with your collections.
Learn how to find keys in a Dictionary like a rockstar .NET dev.
Encore here:
#dotnet #dotnet10 #MVPBuzz #CodePerformance
dotnettips.wordpress.com/2024/04/05/c...
Collection Performance: Comparing Key Search Methods in Dictionaries
The post discusses two methods for searching a specific key in a Dictionary. The ContainsKey() method is recommended by Microsoft for improved performance but is it more performant?
dotnettips.wordpress.com
October 2, 2026 at 3:10 PM
Allocations slowing you down? I walk through using ArrayPool to cut churn and boost throughput—plus results from Spargine’s PasswordHasher. Quick wins inside 🔧⚡
#dotnet10 #CodePerformance #MVPBuzz
dotnettips.wordpress.com/2025/10/01/o...
Optimizing Array Performance in .NET: Getting the Most from ArrayPool
ArrayPool optimizes memory usage by providing a thread-safe pool of reusable arrays, significantly reducing allocations and garbage collection pressure, especially in high-performance scenarios. It…
dotnettips.wordpress.com
October 1, 2026 at 2:53 PM
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