-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Remove IsFastSort optimizations from String #26759
Conversation
Performance results: The current microbenchmarks in performance repo are running the same tests on the same string, so they are helped by the cached state. For example, results for Before:
After:
The scenario tested by the microbenchmarks is not realistic. It is unlikely that real workloads are going to be running the same IndexOf on two exact same string instances repeatedly. When the microbenchmark is modified to create a fresh instance of string using Before:
After:
@adamsitnik Is it worth it to update the micro-benchmarks for IndexOf and similar operations to create string clones to be more realistic? |
Yes. I am going to implement more realistic benchmarks dotnet/performance#885 |
The Windows failures seems to be not related. I am going to re-run the tests /azp run |
The Linux failures might have exposed differences between the Edit: I did not find any significant difference for |
src/System.Private.CoreLib/shared/System/Globalization/CompareInfo.Unix.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to Tarek's comments re: improving test cases, but otherwise LGTM.
@tarekgh The following test case is failing with my changes:
We return true with my change because of The same bug exists in Span version of StartsWith. We have test coverage hole for the Span version of StartsWith. |
|
I think that's fine. Thanks! |
I am fixing the test coverage hole for Span-based globalization methods in dotnet/corefx#41224 |
- Fix bugs in the Span-based globalization fast paths. Note that some of these bug fixes are going to affect performance of the globalization fast paths. - Use Span-based globalization fast paths for strings - Avoid static array allocation for HighCharTable Fixes #26758
b092d28
to
4dc388e
Compare
This reverts commit 0da2746.
src/System.Private.CoreLib/shared/System/Globalization/CompareInfo.Unix.cs
Show resolved
Hide resolved
@jkotas could you please wait with merging this PR until I finish dotnet/performance#892 ? I just want to make sure that this change is tracked properly in our performance reporting system. It should be a matter of hours from now |
@jkotas thanks for reviewing dotnet/performance#892 , I've merged it just right now. We run all benchmarks every 4 hours and it takes +-1h to run all Unix benchmarks (they are distributed to multiple machines). So 5h from now we can merge this PR. I hope it's not a problem! |
No problem. Thank you! |
* Remove IsFastSort optimizations from String - Fix bugs in the Span-based globalization fast paths. Note that some of these bug fixes are going to affect performance of the globalization fast paths. - Use Span-based globalization fast paths for strings - Avoid static array allocation for HighCharTable Fixes dotnet#26758 Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Remove IsFastSort optimizations from String - Fix bugs in the Span-based globalization fast paths. Note that some of these bug fixes are going to affect performance of the globalization fast paths. - Use Span-based globalization fast paths for strings - Avoid static array allocation for HighCharTable Fixes dotnet#26758 Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Remove IsFastSort optimizations from String - Fix bugs in the Span-based globalization fast paths. Note that some of these bug fixes are going to affect performance of the globalization fast paths. - Use Span-based globalization fast paths for strings - Avoid static array allocation for HighCharTable Fixes #26758 Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Remove IsFastSort optimizations from String - Fix bugs in the Span-based globalization fast paths. Note that some of these bug fixes are going to affect performance of the globalization fast paths. - Use Span-based globalization fast paths for strings - Avoid static array allocation for HighCharTable Fixes #26758 Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Remove IsFastSort optimizations from String - Fix bugs in the Span-based globalization fast paths. Note that some of these bug fixes are going to affect performance of the globalization fast paths. - Use Span-based globalization fast paths for strings - Avoid static array allocation for HighCharTable Fixes #26758 Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Remove IsFastSort optimizations from String - Fix bugs in the Span-based globalization fast paths. Note that some of these bug fixes are going to affect performance of the globalization fast paths. - Use Span-based globalization fast paths for strings - Avoid static array allocation for HighCharTable Fixes #26758 Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Remove IsFastSort optimizations from String - Fix bugs in the Span-based globalization fast paths. Note that some of these bug fixes are going to affect performance of the globalization fast paths. - Use Span-based globalization fast paths for strings - Avoid static array allocation for HighCharTable Fixes #26758 Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Fixes #26758