.NET performance optimization – Collections.Pooled collection type is recommended

Original link: https://ldqk.xyz/2170

Performance optimization is how to occupy fewer resources while ensuring that the same number of requests are processed, and this resource is generally CPU or memory, of course, operating system IO handles, network traffic, disk usage, and so on. But most of the time, we are reducing CPU and memory usage. The content shared before has some limitations, and it is difficult to directly transform it. Today, I want to share a simple method with you. You only need to replace a few collection types to achieve the effect of improving performance and reducing memory usage. Today I want to share a class library with you. This class library is called Collections.Pooled. As you can see from the name, it achieves the purpose of reducing memory usage and GC by pooling memory. We will take a look at its performance later. In the end, I will also show you the source code and why it will bring these performance improvements.

This article is reprinted from: https://ldqk.xyz/2170
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment