-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 MemoryExtensions.Split over string.Split to decrease allocations/improve perf #9600
Conversation
src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Annotations/Annotation.cs
Outdated
Show resolved
Hide resolved
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.
LGTM.
@h3xds1nz, Found the additional assignments of Range[]
a very interesting way to discard or deal with unwanted and extra splits. Enjoyed reviewing this!
Can you please resolve conflicts and this is good to be taken in.
2b4a984
to
81187b1
Compare
@harshit7962 Thank you, glad you've enjoyed it! Resolved the conflicts :) |
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.
Re-Approving
@h3xds1nz Thanks again for the contribution! |
@harshit7962 Thanks again for reviewing :) |
@harshit7962 you didn't squash by the way, all my ugly commit messages out in the main branch now haha. |
Description
Picks off most places where
string.Split
is used just for parts count or where additional operations are performed on the split strings so it makes sense to work withReadOnlySpan<char>
/SpanSplitEnumerator<char>
instead.Using
string.Split
vsSpanSplitEnumerator<char>
for countingBenchmark code
Customer Impact
Improved performance, decreased allocations.
Regression
No.
Testing
Local build/CI.
Risk
Low.
Microsoft Reviewers: Open in CodeFlow