am assuming that .NET 5, which is currently in preview, will be faster than .NET Core 3.1. There are many additional performance improvements to be found in .NET 5. I plan to write a similar post once .NET 5 has been released and closer to the final version.It should be noted that none of the benchmarks used here are realistic. In a traditional application, you would have a lot of strings, StringBuilders, service calls, database calls etc. It's not clear what Microsoft was thinking with advertising Span, but we tried it out in an application that uses a lot of strings (ie: mainframes work only with strings). The functionality was very limited and we didn't benefit from Span at all. It didn't add any value. Yes, there might be some performance benefits if we could use it in a real-world scenario, but for now, it just seems like more marketing hype than actual performance improvement. Nevertheless, thank you for taking the time to read this article and provide your feedback."Awesome performance, Stephen!"I've seen a good performance bump over .NET 4.6.2 BUT:

've been searching for information on how to effectively port a large SDK that contains 79 projects from .NET Framework to .NET Core 3. Unfortunately, my search has yielded little success in finding such information. Despite this, I have managed to successfully port some of the projects and have observed a significant increase in macro performance over the previous version (.NET 4.6.2).

To clarify, macro performance refers to the execution of long-running tasks that utilize multiple threads. In terms of specific issues faced during the porting process, we encountered two main challenges with .NET Core 3:

1. Stack Size: Tests running against corrupt/malicious documents threw stack overflow exceptions when executed on .NET Core 3, whereas they did not on previous versions (.NET 4.6.2 or 4.8). While there are mechanisms to limit recursion depth, these do not entirely solve the issue and can still result in uncatchable exceptions being thrown. Moreover, reducing the maximum recursion depth counter by more than 50% will still cause a throwable exception in .NET Core 3. This is different from previous versions where such exceptions would only be thrown at levels twice as deep. However, the unwinding time of the stack in .NET Framework was much quicker compared to that of .NET Core 3.

This is a very interesting issue with .NET Core. These deeply nested exceptions can be quite expensive in terms of performance compared to the .NET Framework. It seems like there may be an issue with unwinding the stack, which could be causing these exceptions to occur more frequently.

One specific area of concern is the CodePagesEncodingProvider.Instance.GetEncoding method, which is still experiencing issues even after installing a Nuget package that includes code page support. This could be contributing to the overall problem of deeper stack traces and slower exception handling.

To address this issue, I have been using Thread classes and one test that uses Parallel.ForEach (thread pool). Note that reducing the max recursion depth above for .NET Core can also impact the processing of some normal/valid documents.

Thank you for your help and expertise in this matter. Have you considered opening issues in dotnet/runtime with reproductions of the regressions you are seeing? Your input would be greatly appreciated.

Great Article Stephen! As .NET Core 3.0 is finally released, wouldn't it be better to simply run the cycle again and update what the results are?

I am glad you enjoyed the post! Yes, it could certainly help to run additional cycles and gather updated data on the improvements being made to .NET Core. Thank you for your feedback!

Measurements look promising, I cannot wait to get my hands on it and see those improvements for myself.

Thank you! It will be exciting to see the results of your efforts. Well done on all of the optimization work so far.

Performance improvements for websockets based applications are a hot topic, and there's a lot of discussion around implementing the compression algorithm known as "permessage-deflate" in the next release of ASP.NET Core. This technology has the potential to significantly reduce the amount of data transmitted over the network, leading to faster application performance.

It's worth noting that benchmark tracking can sometimes show performance regressions, but it's important to keep in mind that these graphs track active development branches and experimental efforts, so fluctuations in performance may be a natural part of the software development process. In any case, it's always a good idea to monitor performance metrics and identify areas where improvements can be made.

One area where performance could potentially improve in .NET is disk i/O. There have been some reports of slower disk I/O speeds in Windows compared to Linux, which can have a significant impact on application performance. However, there have also been recent improvements in this area, particularly in Windows Server. It will be interesting to see how these developments continue in the future and whether they will lead to a more competitive edge for .NET on the platform.

Finally, congratulations on the release of ASP.NET Core! It's great to see the team and community working together to make improvements and push the technology forward. Keep up the excellent work!