Vectorized SequenceCompareTo for Span<char> (#17237)
authorJan Kotas <jkotas@microsoft.com>
Tue, 27 Mar 2018 07:27:21 +0000 (00:27 -0700)
committerGitHub <noreply@github.com>
Tue, 27 Mar 2018 07:27:21 +0000 (00:27 -0700)
commit9e078ffab41899650419a5928832a4302b6881e0
treed93c373a4739e5d60c28e3e238bca72febee87ca
parent6b3d2dd677f5637e89153e8277184eca93152338
Vectorized SequenceCompareTo for Span<char> (#17237)

- This change makes the compare for very short Span strings a bit slower and for longer Span strings many times faster.
- Switch several places where it was a clear benefit to use it.
`String.CompareOrdinal(string,string)` is notable exception that I have left intact for now. It is fine tuned for current string layout, and replacing with a call of vectorized SequenceCompareTo gives mixed results.
src/classlibnative/bcltype/stringnative.cpp
src/mscorlib/shared/System.Private.CoreLib.Shared.projitems
src/mscorlib/shared/System/Globalization/CompareInfo.cs
src/mscorlib/shared/System/MemoryExtensions.cs
src/mscorlib/shared/System/SpanHelpers.Char.cs [new file with mode: 0644]
src/mscorlib/shared/System/SpanHelpers.T.cs
src/mscorlib/shared/System/String.Manipulation.cs
src/mscorlib/src/System/String.Comparison.cs
src/vm/ecalllist.h
src/vm/object.cpp
src/vm/object.h