Hi guys
the attached test runs on my machine (Powershell V7) astonishingly 30 seconds.
Can this be true? It has only 10k records and I dont get the performance issue?
Can you please clarify the issue?
Thanks,
Alex
$myTest = Get-Content 'tmp.txt' | ConvertFrom-Json | Select-Object 'InputObject'
Measure-Command {
$myTest | ForEach-Object -parallel {}
}
This shouldnt take 30 seconds imho
$PSVersionTable.PSVersion
Major Minor Patch PreReleaseLabel BuildLabel
----- ----- ----- --------------- ----------
7 0 0
@Schwanowski In 7.0 new runspaces is created for every input object. It is really slow.
You can try latest 7.1 preview nightly build where some optimizations was added.
Additionally, if the overall processing required for each runspace is small, you will have better results in both versions if you batch the inputs for processing.
Thanks, we can leave this for the moment. I will try this again when 7.1 is out