System.Linq.ParallelMergeOptions
Inheritance
Object
↳ Enum
↳ System.ValueType
↳ System.Enum
↳ System.Linq.ParallelMergeOptions
Enum Members
-
DefaultDefault
Specifies the default merge option. The system chooses the best option based on the operation and data.
-
FullyBufferedFullyBuffered
Specifies that results should be fully buffered before being merged. This can improve performance for some operations but may increase memory usage.
-
AutoBufferedAutoBuffered
Specifies that results should be buffered as needed. The system dynamically adjusts buffering based on performance characteristics.
Remarks
The ParallelMergeOptions
enumeration is used to control how results from parallel LINQ operations are merged. The choice of merge option can significantly impact performance and memory usage.
For example, when performing operations like OrderBy
or GroupBy
, the ordering of elements is crucial. The merge options allow you to specify the degree to which the system should preserve this ordering.
Default
is often a good starting point, allowing the query execution engine to make intelligent decisions. However, for specific scenarios where you observe performance bottlenecks or excessive memory consumption, experimenting with FullyBuffered
or AutoBuffered
might be beneficial.
Requirements
Assembly: System.Linq.Parallel.dll
Namespace: System.Linq
Platform: .NET Core 3.0, .NET 5+, .NET Standard 2.1+