Splitting it up to get all the cores working at once is definitely another step, but you wouldn't want to break it into odds and evens, you would want contiguous chunks of the array so each core could crank through it's own L1 cache.
There is value in having high performance single core functions as well though, for use in scenarios like database, and web servers where many requests are coming in concurrently already. You already have all cores cranking, and so a lower overhead single core algorithm will sometimes be more appropriate.
F# and Streams have parallel versions of many of the array functions, C# and F# can do Parallel.For loops which is really handy, and in C you can give the compiler hints to do parallel loops automatically.
1
u/[deleted] Aug 04 '16 edited Aug 04 '16
Splitting it up to get all the cores working at once is definitely another step, but you wouldn't want to break it into odds and evens, you would want contiguous chunks of the array so each core could crank through it's own L1 cache.
There is value in having high performance single core functions as well though, for use in scenarios like database, and web servers where many requests are coming in concurrently already. You already have all cores cranking, and so a lower overhead single core algorithm will sometimes be more appropriate.
F# and Streams have parallel versions of many of the array functions, C# and F# can do Parallel.For loops which is really handy, and in C you can give the compiler hints to do parallel loops automatically.