【文件属性】:
文件名称:ListPool:使用ArrayPool优化IList的无分配实现
文件大小:163KB
文件格式:ZIP
更新时间:2021-05-24 09:18:50
list performance collection dotnet buffer
列表池
使用具有两个变体的ListPool
和ValueListPool实现IList的无分配实现
安装
在上
PM> Install-Package ListPool
要求:
System.Memory(> = 4.5.3)
介绍
当性能很重要时, ListPool提供ArrayPool的所有优势以及IList的可用性,对Span支持和序列化。
它具有两个高性能变体ListPool和ValueListPool 。
我们推荐使用ListPool在ValueListPool对于大多数的使用情况。 在使用带有stackalloc的原始类型的小集合时,或者在重用数组时,应该使用ValueListPool 。
差异:
ListPool :
参考类型
可序列化
因为它是一个类,所以无论大小如何,它都有约56个字节的恒定堆分