My script parses a 200,000-line CSV log. It starts with $results = @() and does $results += $obj for each line inside a foreach loop. With small test files it is instant, but the full file takes many minutes, and the time seems to grow much faster than the file size.
Why is appending to an array so slow in PowerShell, and what should I use to collect a large number of objects?




