Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve performance on json to psobject conversion (PowerShell#7482)
This amounts so a speed-up in the order of 7x. Cmdlets that benefit from this are `Convertfrom-Json` and `Invoke-RestMethod`. There are three main changes: - Convert from `JArray` directly to object array instead of creating a `List` and do `list.ToArray()`. - Avoid iterating through `PSObject.Properties` to check for existing members, since that is a very slow and allocation heavy code path. - Pre-allocate the members in `PSObject` by using the newly added constructor accepting an initial member count.
- Loading branch information