This year, the author explored faster data processing methods using Span in .NET, specifically for converting Base64 strings to byte arrays. The article aims to assist developers in making informed decisions.
Tag: Strings
Boost Your .NET Projects: Unleashing the Power of Spargine’s UlidGenerator
Spargine is an open-source set of .NET 8 assemblies and NuGet packages created for efficient ULID generation, combining randomness with alphabetical sorting. ULIDs are compact, sortable identifiers offering uniqueness for distributed systems. The UlidGenerator class provides methods for generating ULIDs.
Boost Your .NET Projects with Spargine: Maximize JSON Performance with JsonSerialization
The JsonSerialization class in DotNetTips.Spargine.Core offers efficient JSON serialization and deserialization, leveraging .NET’s System.Text.Json.JsonSerializer. It includes methods with JsonSerializerOptions and JsonTypeInfo for enhanced performance and flexibility. The class supports robust validation, ensuring high reliability and low memory usage, making it ideal for high-performance applications.
String Performance: Optimizing Resource-Based String Formatting in .NET
The content emphasizes the importance of storing user-visible strings in project resources for globalization. It introduces the CompositeFormat class from .NET 5, highlighting its benefits: consistent formatting, ease of maintenance, enhanced readability, flexible options, localization support, parameter reusability, and separation of logic from presentation. Notably, it offers performance advantages over other formatting methods.
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#.
Code It Any Way You Want: Constants vs. Properties
The post discusses the importance of using constants for static numerical or string values in code, highlighting benefits such as clarity of intent. It provides an example of a read-only property for π and notes that .NET 10 benchmarks show similar performance for both methods. EditorConfig settings for identifying issues are also mentioned.
Mastering Globalization
Globalization is essential for application development and should be integrated from the start, not as an afterthought. It encompasses more than just text translation, including nuances of languages, cultures, and data formats. Proper implementation enhances performance and user experience worldwide, while neglecting it can lead to significant difficulties and costs later.
Optimizing String Performance
Strings in .NET can severely impact performance if not managed properly. This guide explores string performance optimization, covering issues like concatenation, formatting, and memory allocation. It provides practical solutions using tools like StringBuilder and spans, offering benchmark-driven strategies to enhance application efficiency for developers dealing with strings.
Code It Any Way You Want: Optimal Parameter Passing – Array vs. Params Keyword
The article explores the performance differences between passing parameters as arrays or using the params keyword in C#. Despite similarities in speed, the author recommends using the params keyword for its ease of use during function calls.
String Performance: Appending a Character using the StringBuilder
The use of a single character with a StringBuilder from an ObjectPool can improve performance. Benchmark results show similar overall performance, but without an ObjectPool, using a character becomes more significant. It is recommended to use a character in such cases. EditorConfig setup can check for this issue using dotnet_diagnostic.CA1834.severity = warning.

You must be logged in to post a comment.