-
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
Add plain Vector128 support to IndexOfAnyAsciiSearcher #92680
Conversation
Tagging subscribers to this area: @dotnet/area-system-buffers Issue DetailsContributes to dotnet/perf-autofiling-issues#21818 I believe this should be an okay implementation correctness-wise, but it's up to Mono implementations how efficiently they can handle the @fanyang-mono could you please check how this impacts Mono perf?
|
For initial validation, please run affected microbenchmarks from dotnet/perf-autofiling-issues#21818 using this script https://github.com/dotnet/performance/blob/main/scripts/benchmarks_local.py You should run them against both Mono JIT and Mono interpreter. It could be achieved by passing |
@@ -42,7 +42,7 @@ internal override int IndexOfAny(ReadOnlySpan<char> span) | |||
|
|||
// We check whether the first character is ASCII before calling into IndexOfAnyAsciiSearcher | |||
// in order to minimize the overhead this fast-path has on non-ASCII texts. | |||
if (IndexOfAnyAsciiSearcher.IsVectorizationSupported && span.Length >= Vector128<short>.Count && char.IsAscii(span[0])) |
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.
I think we need to keep IsSupported
checks to ensure trimming works as expected on platforms without SIMD support.
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.
Is that needed even though all its ctor uses are guarded behind it?
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.
R2R has some special rules for various ISA checks and I'm pretty sure we expect them to be used even when all callers are expected to guard a given path.
CC. @davidwrighton
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
Contributes to dotnet/perf-autofiling-issues#21818
I believe this should be an okay implementation correctness-wise, but it's up to Mono implementations how efficiently they can handle the
Vector128
paths (e.g. efficiently handingVector128.Shuffle
with non-const indices).@fanyang-mono could you please check how this impacts Mono perf?
We shouldn't merge this without good validation as it will affect most uses of
SearchValues
.