parallel.For function I am trying to add parallelism. The following function works.  For testing purposes, calculating chunckLength is fine. However, when I allocate more cores, it seems to slow down significantly which seems due to massive overhead. The visualisation shows the average core utilisation during execution. Each run, the function is iterated over 10 times with lists of 10000 elements.

I am fairly new to F# (as you can probably tell from the functions structure...), so any suggestions on how to optimise it so I can achieve some speed-up would help greatly.

let pmap_tpl_parforlb f (xs:list&lt;_&gt;) =
let xs_arr = xs.ToArray()
let chunkLength = xs.Length / numProc
Parallel.For(0,numProc,fun c -&gt;
    let x = c * chunkLength
    let y = (c * chunkLength) + chunkLength
    for x in 0..y-1 do
        xs_arr.[x] &lt;- f (xs_arr.[x])
) |&gt; ignore
Have you tried not using explicit chunk sizes? Parallel.For does some fancy chunking (range-splitting) and load-balancing under the hood, which usually gives very good performance on it's own.

In other words, try a simpler solution first, e.g.,:

let mapInPlace (mapping : 'T -&gt; 'T) (array : 'T[]) : unit =
    Parallel.For (0, array.Length, fun i -&gt;
        array.[i] &lt;- mapping array.[i])
    |&gt; ignore


Another point -- if you're iterating over lists of 10000 elements, you should convert those lists to an array once, then call your iterative function however many times you need to. I suspect you're losing a non-trivial amount of performance from doing the list-to-array conversion repeatedly.