Skip to content

Commit d1fd5df

Browse files
authored
Update script-authoring-considerations.md
1 parent 69b8082 commit d1fd5df

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

reference/docs-conceptual/dev-cross-plat/performance/script-authoring-considerations.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ $results += Get-SomethingElse
113113
$results
114114
```
115115

116-
>[!NOTE] In PowerShell 7.5, array addition has been optimized and no longer creates a new array for each operation. The performance considerations described here should only be used in environments where PowerShell versions prior to 7.5 are in use. For more information, see [What's New in PowerShell 7.5](https://learn.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-75?view=powershell-7.5#engine-improvements).
116+
>[!NOTE]
117+
> In PowerShell 7.5, array addition was optimized and no longer creates a new array for each
118+
> operation. The performance considerations described here still apply to PowerShell versions
119+
> prior to 7.5. For more information, see [What's New in PowerShell 7.5][01].
117120
118121
Array addition is inefficient because arrays have a fixed size. Each addition to the array creates
119122
a new array big enough to hold all elements of both the left and right operands. The elements of
@@ -882,21 +885,22 @@ Iterations Test TotalMilliseconds RelativeSpeed
882885
- [Add-Member][18]
883886

884887
<!-- Link reference definitions -->
888+
[01]: ../whats-new/what-s-new-in-powershell-75.md#engine-improvements
885889
[02]: ../../learn/deep-dives/everything-about-hashtable.md
886890
[03]: ../../learn/deep-dives/everything-about-null.md
887891
[04]: xref:System.Void
888892
[05]: xref:Microsoft.PowerShell.Core.Out-Null
889893
[06]: xref:System.Collections.Generic.List`1
890-
[07]: xref:System.Collections.Generic.List`1.Add*
894+
[07]: xref:System.Collections.Generic.List`1.Add%2A
891895
[08]: xref:System.String
892896
[09]: xref:System.Int32
893897
[10]: xref:System.Object
894-
[11]: xref:System.Collections.Generic.List`1.ToArray*#system-collections-generic-list-1-toarray
898+
[11]: xref:System.Collections.Generic.List%601.ToArray%2A#system-collections-generic-list-1-toarray
895899
[12]: xref:System.Collections.ArrayList
896900
[13]: /powershell/module/microsoft.powershell.core/about/about_join
897901
[14]: xref:System.Text.StringBuilder
898902
[15]: xref:System.IO.StreamReader
899-
[16]: xref:System.IO.File.ReadLines*
903+
[16]: xref:System.IO.File.ReadLines%2A
900904
[17]: xref:Microsoft.PowerShell.Utility.Write-Host
901905
[18]: xref:Microsoft.PowerShell.Utility.Add-Member
902906
[19]: /powershell/module/microsoft.powershell.core/about/about_hash_tables#creating-ordered-dictionaries

0 commit comments

Comments
 (0)