提交 5902ec51 编写于 作者: S Sam Harwell

Add usage notes for SegmentedArray<T>

上级 25018526
......@@ -2,4 +2,10 @@
This package contains shared code implementing specialized collection types.
* `SegmentedArray<T>`: This type behaves similarly to `T[]`, but segments the underlying storage to avoid allocating arrays in the Large Object Heap.
* `SegmentedArray<T>`: This type behaves similarly to `T[]`, but segments the underlying storage to avoid allocating arrays in the Large Object Heap. This type is most applicable in scenarios where all of the following hold:
* The code currently uses `T[]`
* The code relies on the performance characteristics `T[]` (O(1) reads and writes, storage density, and/or data locality, such that tree-based data structures like `ImmutableList<T>` are not acceptable)
* The implementation does not need to use `AsMemory()`/`AsSpan()` on this instance to treat it as a `Memory<T>`/`Span<T>` (this operation requires the entire array be continuous in memory)
* Application profiling suggests that allocations of `T[]` in the Large Object Heap are causing performance problems that need to be addressed
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册