Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
rzikm merged 4 commits intodotnet:mainfromYohDeadfall:builder-instead-of-concat
Jan 2, 2024

Conversation

@YohDeadfall
Copy link
Contributor

Description

The proposed change is just a simple optimization of mail address collection encoding and touches only the collection type itself, notMailAddress 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.

@ghostghost added community-contributionIndicates that the PR has been added by a community member area-System.Net labelsDec 7, 2023
@ghost
Copy link

Tagging subscribers to this area: @dotnet/ncl
See info inarea-owners.md if you want to be subscribed.

Issue Details

Description

The proposed change is just a simple optimization of mail address collection encoding and touches only the collection type itself, notMailAddress 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.

Author:YohDeadfall
Assignees:-
Labels:

area-System.Net,community-contribution

Milestone:-

Copy link
Member

@rzikmrzikm left a 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 usingValueStringBuilder as huoyaoyuan suggested?

@YohDeadfall
Copy link
ContributorAuthor

Yup, will use it instead of theStringBuilder.

rzikm reacted with heart emoji

@YohDeadfall
Copy link
ContributorAuthor

@rzikm, could you help me with that weird error happening only for some builds?

src/libraries/System.Net.Mail/src/System/Net/Mail/MailAddressCollection.cs(54,40): error CS0122: (NETCORE_ENGINEERING_TELEMETRY=Build) 'ValueStringBuilder' is inaccessible due to its protection level

@ManickaP
Copy link
Member

ValueStringBuilder is an internal type shared by linking the source file. You need to add it to the csproj like for example here:

<CompileInclude="$(CommonPath)System\Text\ValueStringBuilder.cs"
Link="Common\System\Text\ValueStringBuilder.cs" />

@YohDeadfall
Copy link
ContributorAuthor

That's exactly what I did:

<CompileInclude="$(CommonPath)System\Text\ValueStringBuilder.cs"
Link="Common\System\Text\ValueStringBuilder.cs" />

And it's in the same block whereMailAddressCollection.cs is, no more groups where the collection is mentioned. For whatever reason it's not included in some cases while I see no directives which might control that.

@rzikm
Copy link
Member

rzikm commentedJan 2, 2024
edited
Loading

@YohDeadfall The build failure is in unit test project, you need to include theValueStringBuilder.cs insrc\libraries\System.Net.Mail\tests\Unit\System.Net.Mail .Unit.Tests.csproj as well

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.

YohDeadfall reacted with thumbs up emoji

@rzikmrzikm self-assigned thisJan 2, 2024
@YohDeadfall
Copy link
ContributorAuthor

@rzikm, now it looks fine, thank you!

@rzikm
Copy link
Member

CI is passing, the one failure is unrelated. looks good now.

@rzikm
Copy link
Member

Thanks a lot for the patience with the contribution!

YohDeadfall reacted with heart emoji

@rzikmrzikm merged commite3d5a65 intodotnet:mainJan 2, 2024
@YohDeadfallYohDeadfall deleted the builder-instead-of-concat branchJanuary 2, 2024 16:48
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsFeb 2, 2024
@karelzkarelz added this to the9.0.0 milestoneMay 14, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@danmoseleydanmoseleydanmoseley left review comments

@rzikmrzikmrzikm approved these changes

+1 more reviewer

@huoyaoyuanhuoyaoyuanhuoyaoyuan left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

@rzikmrzikm

Labels

area-System.Netcommunity-contributionIndicates that the PR has been added by a community member

Projects

None yet

Milestone

9.0.0

Development

Successfully merging this pull request may close these issues.

6 participants

@YohDeadfall@ManickaP@rzikm@huoyaoyuan@danmoseley@karelz

[8]ページ先頭

©2009-2025 Movatter.jp