-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Improve char.IsWhiteSpace for non-ASCII #111569
Conversation
Tagging subscribers to this area: @dotnet/area-system-globalization |
@AndyAyersMS, @EgorBo, is this expected? |
The fact that PGO may slow things if they change behavior after Tier1-PGO was reached? Yes. Unfortunately, we're quite far away from being able to deoptimize/recollect PGO for such cases. Although, it is indeed possible that inliner is too strict for blocks which currently have 0 weights, but if we relax it - we'll have to inline less in hot ones to maintain the balance |
This |
You can resort to As @EgorBo says, adjusting heuristics for call sites that look to be cold is tricky, there are a lot of these sites and most of them shouldn't be inlined. |
This reverts commit e2874f5.
char.IsWhiteSpace
looks something likeIf you just run a microbenchmark over this with non-ASCII input, things will be fine as PGO will inline the whole thing together.
But if
IsWhiteSpace
ends up tiering up without seeing data super skewed for non-ASCII, theGetCategoryCasingTableOffsetNoBoundsChecks
call in the fallback case won't be inlined, slowing down any future queries for non-ASCII chars.