String.Replace performance improvements in .NET 5 v .NET 6 v .NET 7

It’s amazing to see the performance improvements of String.Replace across multiple versions of .NET 🚀🚀🚀🚀.

When you have such a big improvement from 5 -> 6, you think most possibilities for further optimization are gone, but no in .NET 7 perf improves again 💪🏻 …

If anyone would like to try and re-create the benchmarks the code is here -> StringReplace_dotnet5v6v7.cs (

Leave a Reply

Your email address will not be published. Required fields are marked *