Skip to content

Commit 527ef78

Browse files
authored
Fix assumed type from 0(n) to O(n) (dotnet#8731)
1 parent 7671ccd commit 527ef78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/stringbuilder-perf-note.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Using character-based indexing with the <xref:System.Text.StringBuilder.Chars%2A
66
Performance is severely impacted because each character access walks the entire linked list of chunks to find the correct buffer to index into.
77

88
> [!NOTE]
9-
> Even for a large "chunky" <xref:System.Text.StringBuilder> object, using the <xref:System.Text.StringBuilder.Chars%2A> property for index-based access to one or a small number of characters has a negligible performance impact; typically, it is an **0(n)** operation. The significant performance impact occurs when iterating the characters in the <xref:System.Text.StringBuilder> object, which is an **O(n^2)** operation.
9+
> Even for a large "chunky" <xref:System.Text.StringBuilder> object, using the <xref:System.Text.StringBuilder.Chars%2A> property for index-based access to one or a small number of characters has a negligible performance impact; typically, it is an **O(n)** operation. The significant performance impact occurs when iterating the characters in the <xref:System.Text.StringBuilder> object, which is an **O(n^2)** operation.
1010
1111
If you encounter performance issues when using character-based indexing with <xref:System.Text.StringBuilder> objects, you can use any of the following workarounds:
1212

0 commit comments

Comments
 (0)