-
Notifications
You must be signed in to change notification settings - Fork 9.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
Use span.Equals instead of string.Compare in JumpTables #55724
Use span.Equals instead of string.Compare in JumpTables #55724
Conversation
One thing I'd like to research in a future PR, when I have time to run the perf tests, is whether i.e. deleting |
Seems sensible. FYI @BrennanConroy |
I'm rerunning the failed tests, but it's not trivially obvious that the failures are unrelated. Are you seeing them locally @andrewjsaid? |
Huh: #55696 |
Changes look good to me! |
This is a performance improvement for
LinearSearchJumpTable
andSingleEntryJumpTable
which is used heavily in routing.Description
Instead of relying on
string.Compare
returning0
, we usespan.Equals
. The latter is much more optimized for example with vectorization.Not sure if I must wrap with
#if NET???_OR_GREATER
- would appreciate direction.Standalone benchmark code