The excerpt from "Rock Your Code" explains two methods for retrieving the initiating file's path in .NET.
Tag: Code Performance
General Performance: Exploring Thread ID Retrieval Methods
This article explains two methods to obtain the current thread ID in .NET and shows which method is more performant.
Regular Expression Performance: Supercharge Your Match Counting
String manipulation is crucial in modern applications, significantly impacting performance and memory usage in .NET. learn how to achieve nearly double the speed and zero memory allocations when a count is required from a regular expression.
Microsoft .NET Code Analysis: Efficient String Prefix Checks — StartsWith() vs. IndexOf()
Using IndexOf() for checking if a string starts with a specific value in .NET is inefficient and unclear. This approach performs unnecessary work and obscures intent.
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.
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 enhancing .NET application performance, including coding patterns, memory insights, and benchmarking. This definitive guide is essential for modern .NET developers aiming for speed and scalability.
Supercharging Application Performance with Intelligent Client-Side Caching
This excerpt discusses enhancing Microsoft .NET application performance by minimizing network calls. The author emphasizes client-side caching with Spargine’s InMemoryCache, which drastically improves responsiveness and scalability for costly operations like reflection. While significant speed gains are noted, developers are advised to benchmark changes, as caching may not always be beneficial.
Code It Anyway You Want: Initializing Reference Type Static Fields Inline for Enhanced Code Readability
Microsoft advises initializing reference type static fields inline to enhance code readability and prevent issues from uninitialized fields. Two patterns are shown: inline initialization and using a static constructor. While both methods do not allocate memory, using a static constructor may slightly improve performance. EditorConfig can check for adherence to this guideline.
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 that can significantly improve speed and reduce memory overhead when converting and manipulating arrays.
Boost Your .NET Projects: Find the Fastest Way to Get an Item’s Index in Arrays
This article examines the performance of three index-finding methods in .NET arrays: Array.BinarySearch (O(log n)), Array.FindIndex (O(n)), and Array.IndexOf (O(n)).

You must be logged in to post a comment.