你的位置: 码友网首页 / 资讯源列表 / Reducing allocations by caching with StringBuilderCache: A deep dive on StringBuilder - Part 5

关于[Reducing allocations by caching with StringBuilderCache: A deep dive on StringBuilder - Part 5]的摘要:

So far in this series we've looked in detail at StringBuilder, and how it works under-the-hood. In this post I look at a different type, the internal StringBuilderCache type. This type is used internally in .NET Core and .NET Framework to reduce the cost of creating a StringBuilder. In this post I describe why it's useful, run a small benchmark to see its impact, and walk through the code to show how it works.

原文地址: https://andrewlock.net/a-deep-dive-on-stringbuilder-part-5-reducing-allocations-by-caching-stringbuilders-with-stringbuildercache/

收录时间: 2021-08-11 浏览量: 540 分类: C#

| 0 收藏 | 0