-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 StringSplitOptions.TrimEntries #35740
Add StringSplitOptions.TrimEntries #35740
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpEnvironmentProxy.cs
Show resolved
Hide resolved
Don't we normally wait for API approval before implementing? Or was this scratching a particular itch 😄 |
Before putting up a PR, yes :-( |
The API was quasi-approved during the Jan 14 review. The only work item from that review was to make sure that callers didn't need So now that all concerns have been addressed the only thing that's left for API review is approval. Modulo naming if somebody wants a last-minute enum name change. :) |
I see Probably should check perf impact on String.Split. |
I still need to investigate why some unit tests are failing. The report says that 19 failures occurred, but every test is marked "Pass". So that's fun. :D I didn't perf test this but I don't anticipate much perf impact. The related PR #35733 should slightly improve perf in the Separately, I was experimenting with a design that removes the intermediate array entirely. That should result in less GC pressure in the |
Those are just correctness perf tests, so not taking real measurements. If we expect some kind of perf impact, either a regression or an improvement, I would recommend that you run performance tests locally. We have this guide, https://github.com/dotnet/performance/blob/master/docs/benchmarking-workflow-dotnet-runtime.md, that should help you get started. If you get stuck on anything feel free to contact either Adam or I. Also once these changes go in we will get lab results and we can take a look at the impact that we are measuring there. |
Thanks @DrewScoggins I should have realized that (in fact I'm sure you told me that already 😸 ) |
I'm going to back out the "Remove |
Unit tests were failing due to an off-by-one error in a boundary condition. It's addressed at in the commit 5b07dbc, which is part of this PR. Aside from this and reverting the |
crossgen2 CI failure is #37732 |
Resolves #31038. Marked no merge since still waiting on API review.
This PR is divided into four commits. It's easiest to review each commit individually.
Utf8StringSplitOptions
and redirect all of theUtf8String
infrastructure to the improvedStringSplitOptions
type.string.Split(..., StringSplitOptions.TrimEntries)
core logic and unit tests.I've also done an initial sweep through the winforms (see GrabYourPitchforks/winforms@be2079a) and aspnetcore (see GrabYourPitchforks/aspnetcore@bbf393f) repos to see how they can use these APIs.