-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
dotnet/sdk
#51287Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Linq.Parallelcode-analyzerMarks an issue that suggests a Roslyn analyzerMarks an issue that suggests a Roslyn analyzercode-fixerMarks an issue that suggests a Roslyn code fixerMarks an issue that suggests a Roslyn code fixerin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Description
Using .AsParallel() at the end of a LINQ query, e.g. foreach (var item in src.Select(...).Where(...).AsParallel(...)), is a nop and should either be removed or the AsParallel() moved earlier in the query. I've even seen developers write foreach (var item in src.AsParallel()) thinking it parallelizes the foreach loop, which it doesn't... it'd be good to warn about such misuse.
Category: Performance
Mrxx99, AmrAlSayed0, danielchalmers, ericsampson, NN--- and 1 moreCopilot
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Linq.Parallelcode-analyzerMarks an issue that suggests a Roslyn analyzerMarks an issue that suggests a Roslyn analyzercode-fixerMarks an issue that suggests a Roslyn code fixerMarks an issue that suggests a Roslyn code fixerin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged