-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Replaced string concatenation by StringBuilder usage #95760
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
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsDescriptionThe proposed change is just a simple optimization of mail address collection encoding and touches only the collection type itself, not Customer ImpactA bit smaller pressure on the GC. RegressionNope. TestingExisting tests are enough to cover the change.
|
src/libraries/System.Net.Mail/src/System/Net/Mail/MailAddressCollection.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Mail/src/System/Net/Mail/MailAddressCollection.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.
looks good so far, @YohDeadfall can you look into using ValueStringBuilder
as huoyaoyuan suggested?
Yup, will use it instead of the |
src/libraries/System.Net.Mail/src/System/Net/Mail/MailAddressCollection.cs
Outdated
Show resolved
Hide resolved
3d3d536
to
fc389e6
Compare
373b96f
to
fc389e6
Compare
@rzikm, could you help me with that weird error happening only for some builds?
|
runtime/src/libraries/System.Net.Http/src/System.Net.Http.csproj Lines 161 to 162 in 9e57b6a
|
That's exactly what I did: runtime/src/libraries/System.Net.Mail/src/System.Net.Mail.csproj Lines 71 to 72 in fc389e6
And it's in the same block where |
@YohDeadfall The build failure is in unit test project, you need to include the This is a gimmick of some unit test projects in this repo, we compile the same source codes again as part of unit test projects in order to be able to use internal APIs for testing. |
@rzikm, now it looks fine, thank you! |
CI is passing, the one failure is unrelated. looks good now. |
Thanks a lot for the patience with the contribution! |
Description
The proposed change is just a simple optimization of mail address collection encoding and touches only the collection type itself, not
MailAddress
which uses string concatenation internally in many places.Customer Impact
A bit smaller pressure on the GC.
Regression
Nope.
Testing
Existing tests are enough to cover the change.