Skip to content

Reduce allocation cost of HttpRequestOptions #87234

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

Open
antonfirsov opened this issue Jun 7, 2023 · 2 comments
Open

Reduce allocation cost of HttpRequestOptions #87234

antonfirsov opened this issue Jun 7, 2023 · 2 comments

Comments

@antonfirsov
Copy link
Member

R9 is using HttpRequestMessage.Properties/Options in several cases and we have plans in #86281 to utilize it further. The property bag contains very few elements typically, so the internal dictionary can be substituted by linear lookup over a list of elements.

My recommendation would be to embed a few key-value pairs and allocate an Array over a threshold, like we do in TagList.

@antonfirsov antonfirsov added this to the Future milestone Jun 7, 2023
@ghost
Copy link

ghost commented Jun 7, 2023

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

Issue Details

R9 is using HttpRequestMessage.Properties/Options in several cases and we have plans in #86281 to utilize it further. The property bag contains very few elements typically, so the internal dictionary can be substituted by linear lookup over a list of elements.

My recommendation would be to embed a few key-value pairs and allocate an Array over a threshold, like we do in TagList.

Author: antonfirsov
Assignees: -
Labels:

area-System.Net.Http

Milestone: Future

@antonfirsov
Copy link
Member Author

/cc @noahfalk in case it makes sense to add this to some R9 project board for tracking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant