String Interpolation and StringBuilder in .NET6

In a previous post I have looked into what are the performance characteristics of creating interpolated string in .NET 5 and early previews of .NET 6. With .NET 6 preview 7 or better a new approach is used by the C# compiler with support from the BCL to build interpolated strings.

Fortunately the new way provides a faster approach for the most convenient ways for assembling strings, however it makes my previous post completely obsolete.

For details about the new way DefaultInterpolatedStringHandler builds strings, read: https://devblogs.microsoft.com/dotnet/string-interpolation-in-c-10-and-net-6/

Re-running the benchmarks from the previous post, shows much better memory usage:

Find out more


String Interpolation and StringBuilder

This post looks into different approaches and their performance characteristics for appendnng interpolated like strings. I use BenchmarkDotNet to benchmark the different solutions. In case of all benchmarks I have 3 string properties A, B and C each holding one of these values:

  • hello

  • world

  • how are you

The values of these variables are set in a Global setup step of BencharmarkDotNet. In all benchmarks the three string are concatenate with some punctuations.

Implementation

Find out more


Introduction to APM

In the series of these posts I will look into how we can implement an APM solution for .NET applications. Application Performance Management (APM) helps to monitor and diagnose application performance. There are numerous libraries and tools out there to solve this given problem. In this series of posts I will focus on implementing APM for .NET applications (.NET Framework 461 and above, .NET Core and NET5) with OpenTelemetry.

In the series of these posts I will look into the following topics. The current post looks into creating and recording spans.

  • W3C correlation Id specification

  • Creating and recording spans with ActivitySource

  • Using OpenTelemetry and Jaeger

OpenTelemetry

Find out more


Introduction to APM

In the series of these posts I will look into how we can implement an APM solution for .NET applications. Application Performance Management (APM) helps to monitor and diagnose application performance. There are numerous libraries and tools out there to solve this given problem. In this series of posts I will focus on implementing APM for .NET applications (.NET Framework 461 and above, .NET Core and NET5) with OpenTelemetry.

In the series of these posts I will look into the following topics:

  • W3C correlation Id specification

  • Creating and recording spans with ActivitySource

  • Using OpenTelemetry and Jaeger

This post looks into creating and recording spans.

Find out more


Introduction to APM

In the series of these posts I will look into how we can implement an APM solution for .NET applications. Application Performance Management (APM) helps to monitor and diagnose application performance. There are numerous libraries and tools out there to solve this given problem. In this series of posts I will focus on implementing APM for .NET applications (.NET Framework 461 and above, .NET Core and NET5) with OpenTelemetry.

In the following posts I will look into the following topics, starting with the first one in this post:

  • W3C correlation Id specification

  • Creating and recording spans with ActivitySource

  • Using OpenTelemetry and Jaeger

W3C correlation Id specification

Find out more