How to Beat Array Iteration Performance with Parallelism in C# .NET

added by DotNetKicks
4/1/2019 12:17:03 PM

2 Kicks, 1023 Views

Let's consider a simple programming challenge: Summing all items of a large array. Now it stands to reason that this can be easily optimized by using parallelism. Especially for huge arrays with thousands or millions of elements. It also stands to reason that the processing time with parallelism should take as much as regular time divided by the number of CPU cores.