-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
string.IndexOf(string) poor performance in other cultures #96221
Comments
Tagging subscribers to this area: @dotnet/area-system-globalization Issue DetailsDescriptionAfter migrating an old .NET Framework 4.7.2 windows app to .NET 8.0 I was suprised by it's poor performance. But this happens only if the current culture is set other than English/Invariant. Benchmark running in German culture context
Benchmark running in US culture context (perf as expected)
ReproduceBenchmarkDotNet StringIndexOfFrameworkPerfTest repo You can easily switch the culture context in the BenchmarkDotNet setup method.
|
This is tracked by #40942 |
Description
After migrating an old .NET Framework 4.7.2 windows app to .NET 8.0 I was suprised by it's poor performance.
I traced it down to an 11x times slower string.IndexOf(string) call on a large string (500 kilobyte).
But this happens only if the current culture is set other than English/Invariant.
Benchmark running in German culture context
Benchmark running in US culture context (perf as expected)
Reproduce
BenchmarkDotNet StringIndexOfFrameworkPerfTest repo
You can easily switch the culture context in the BenchmarkDotNet setup method.
The text was updated successfully, but these errors were encountered: