Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

kunalspathak
Copy link
Contributor

Optimize following APIs from System.SpanHelpers using ARM64 hardware intrinsics:

  • IndexOfAny(byte value0, byte value1)
  • IndexOfAny(byte value0, byte value1, byte value2)
Method BEFORE AFTER Diff
IndexOfAnyTwoValues 74.94 69.16 -8%
IndexOfAnyThreeValues 81.69 76.13 -7%

The optimization done is similar to what done for IndexOf in #37624. The lower performance improvement is because earlier the code would have taken Vector.IsHardwareAccelerated path which does decent job in finding the first matching index.

Contributes to #33308 and #33707.

@kunalspathak
Copy link
Contributor Author

kunalspathak commented Jun 15, 2020

@tannergooding , @AntonLapounov

@kunalspathak kunalspathak merged commit cab843c into dotnet:master Jun 16, 2020
@kunalspathak kunalspathak deleted the indexofany_byte branch June 16, 2020 15:12
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants