Why
ConvertFrom-Yaml and ConvertTo-Yaml process every line and scalar through several private helpers that currently use PowerShell operators (-split, -replace, -match, -contains) where equivalent .NET methods would run significantly faster. On large YAML documents the cumulative overhead is measurable, since PowerShell operators carry regex compilation, case-folding, and boxing costs that .NET methods avoid.
What
Internal parsing and serialization helpers should prefer .NET string and collection methods over PowerShell operators when the operator's extra capabilities (regex, wildcard, case-insensitive matching) are not needed, with no behavioral change.
Acceptance criteria
- Parsing and serialization use .NET string/collection methods in place of PowerShell operators where the operator's extra capabilities aren't needed
- All existing tests continue to pass with no behavioral changes
Why
ConvertFrom-YamlandConvertTo-Yamlprocess every line and scalar through several private helpers that currently use PowerShell operators (-split,-replace,-match,-contains) where equivalent .NET methods would run significantly faster. On large YAML documents the cumulative overhead is measurable, since PowerShell operators carry regex compilation, case-folding, and boxing costs that .NET methods avoid.What
Internal parsing and serialization helpers should prefer .NET string and collection methods over PowerShell operators when the operator's extra capabilities (regex, wildcard, case-insensitive matching) are not needed, with no behavioral change.
Acceptance criteria