Skip to content
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

Consuming the return type instead of an interface #95601

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

YohDeadfall
Copy link
Contributor

Description

Since MailAddressParser.ParseMultipleAddresses returns an instance of List<MailAddress> it makes much more sense to comsume it as is rather than do virtual calls and hope that the JIT compiler would eliminate them.

Perhaps it makes more sense even to use a foreach loop, but I decided to go with a simple change and move forward if it's okay.

Regression

Negative regression, i.e. perf improvement.

Testing

No new tests are needed.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Dec 4, 2023
@ghost
Copy link

ghost commented Dec 4, 2023

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

Issue Details

Description

Since MailAddressParser.ParseMultipleAddresses returns an instance of List<MailAddress> it makes much more sense to comsume it as is rather than do virtual calls and hope that the JIT compiler would eliminate them.

Perhaps it makes more sense even to use a foreach loop, but I decided to go with a simple change and move forward if it's okay.

Regression

Negative regression, i.e. perf improvement.

Testing

No new tests are needed.

Author: YohDeadfall
Assignees: -
Labels:

area-System.Net, community-contribution

Milestone: -

@rzikm rzikm merged commit e5c0cbc into dotnet:main Dec 8, 2023
108 of 111 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 8, 2024
@karelz karelz added this to the 9.0.0 milestone May 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants