-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API Proposal]: PLINQ: add ParallelEnumerable
extensions from Enumerable
#98689
Comments
Tagging subscribers to this area: @dotnet/area-system-linq Issue DetailsBackground and motivationThe documentation states API Proposalnamespace System.Linq
public static partial class ParallelEnumerable
{
// Append
// Chunk
// DistinctBy
// ExceptBy
// IntersectBy
// MaxBy
// MinBy
// Order
// OrderDescending
// Prepend
// SkipLast
// TakeLast
// ToHashSet
// TryGetNonEnumeratedCount
// UnionBy
} All the missing extensions from And the new .Net 9 extensions: namespace System.Linq
public static partial class ParallelEnumerable
{
// AggregateBy
// CountBy
// Index
} API UsageEnumerable.Range(0, 100)
.AsParallel()
.Append(200)
.TakeLast(20)
.MinBy(x => x) Alternative DesignsUse RisksNew extensions may not run in parallel (but that's already called out in PLINQ documentation).
|
Tagging subscribers to this area: @dotnet/area-system-linq-parallel Issue DetailsBackground and motivationThe documentation states "PLINQ implements the full set of LINQ standard query operators as extension methods for the System.Linq namespace and has additional operators for parallel operations.", but some new extensions were added to API Proposalnamespace System.Linq
public static partial class ParallelEnumerable
{
// Append
// Chunk
// DistinctBy
// ExceptBy
// IntersectBy
// MaxBy
// MinBy
// Order
// OrderDescending
// Prepend
// SkipLast
// TakeLast
// ToHashSet
// TryGetNonEnumeratedCount
// UnionBy
} All the missing extensions from And the new .Net 9 extensions: namespace System.Linq
public static partial class ParallelEnumerable
{
// AggregateBy
// CountBy
// Index
} API UsageEnumerable.Range(0, 100)
.AsParallel()
.Append(200)
.TakeLast(20)
.MinBy(x => x) Alternative DesignsUse RisksNew extensions may not run in parallel (but that's already called out in PLINQ documentation).
|
Some of the methods that you listed such as |
Exactly. Also, I'm sure I missed some new overloads for existing extensions (like |
Background and motivation
The documentation states "PLINQ implements the full set of LINQ standard query operators as extension methods for the System.Linq namespace and has additional operators for parallel operations.", but some new extensions were added to
System.Linq.Enumerable
that are missing inSystem.Linq.ParallelEnumerable
. I propose they be added so that further queries will continue to be parallelizable (even if some extensions can't be parallelized, they should still returnParallelQuery<T>
).API Proposal
All the missing extensions from
System.Linq.Enumerable
, with the same shape (I didn't bother to write out the full declarations for brevity).And the new .Net 9 extensions:
API Usage
Alternative Designs
Use
.AsSequential()
before using the new extensions.Risks
New extensions may not run in parallel (but that's already called out in PLINQ documentation).
The text was updated successfully, but these errors were encountered: