-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Optimize Ordinal.EqualsIgnoreCase_Vector with AVX2 and AVX512 #93116
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);
}
}
|
src/libraries/System.Private.CoreLib/src/System/Globalization/Ordinal.cs
Show resolved
Hide resolved
1e0d45c
to
253c25a
Compare
@stephentoub @tannergooding PTAL, some notes:
Had to replace == with Equals due to #93174 |
Ping, also cc @adamsitnik @MihaZupan who authored/contributed Ascii.cs where I copied this code from |
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.
This LGTM
Closes #92497
Currently,
str1.Equals(str2, StringComparison.OrdinalIgnoreCase)
is only accelerated withVector128
, this PR addsVector256
andVector512
viaISimdVector
abstraction - the best part that there is no code duplication.