Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct wrong claim about StringBuilder performance. #2253

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ If readability is your primary concern (and it usually should be), the LINQ-base
The `Array.Reverse()` approach is the best performing apporach.
For a more detailed breakdown, check the [performance article][article-performance].

The `StringBuilder` approach has the worst performance of the listed approach, and is more error-prone to write as it has to deal with lower and upper bounds checking.
The `StringBuilder` approach has the second worst performance (after the LINQ-based) of the listed approach, and is more error-prone to write as it has to deal with lower and upper bounds checking.

[constructor-array-chars]: https://learn.microsoft.com/en-us/dotnet/api/system.string.-ctor
[article-performance]: https://exercism.org/tracks/csharp/exercises/reverse-string/articles/performance
Expand Down
Loading