Optimize Ordinal.EqualsIgnoreCase_Vector with AVX2 and AVX512#93116
Merged
EgorBo merged 5 commits intodotnet:mainfrom Oct 15, 2023
Merged
Optimize Ordinal.EqualsIgnoreCase_Vector with AVX2 and AVX512#93116EgorBo merged 5 commits intodotnet:mainfrom
EgorBo merged 5 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-runtime Issue DetailsCloses #92497 Currently, public class Benchmarks
{
static readonly string s1 = @"C:\prj\runtime\src\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj";
static readonly string s2 = @"C:\prj\runtime\src\coreclr\System.Private.CoreLib\system.Private.CoreLib.csproj";
[Benchmark]
public bool EqualsIgnoreCase()
{
return s1.Equals(s2, StringComparison.OrdinalIgnoreCase);
}
}
|
neon-sunset
reviewed
Oct 6, 2023
src/libraries/System.Private.CoreLib/src/System/Globalization/Ordinal.cs
Show resolved
Hide resolved
1e0d45c to
253c25a
Compare
This was referenced Oct 6, 2023
Member
Author
|
@stephentoub @tannergooding PTAL, some notes:
Had to replace == with Equals due to #93174 |
Member
Author
|
Ping, also cc @adamsitnik @MihaZupan who authored/contributed Ascii.cs where I copied this code from |
MihaZupan
approved these changes
Oct 13, 2023
src/libraries/System.Private.CoreLib/src/System/Globalization/Ordinal.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Globalization/Ordinal.cs
Show resolved
Hide resolved
This was referenced Oct 24, 2023
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #92497
Currently,
str1.Equals(str2, StringComparison.OrdinalIgnoreCase)is only accelerated withVector128, this PR addsVector256andVector512viaISimdVectorabstraction - the best part that there is no code duplication.