Skip to content

[Uri] Uri.ReCreateParts allocates a char[] that could be avoided #22903

@stephentoub

Description

@stephentoub

Accessing a property like Uri.PathAndQuery not only allocates the resulting string, but also a char[] that's often larger than necessary and which is then used to create that resulting string. Whenever/wherever possible, it'd be good to avoid that allocation.

As an example of the impact of this allocation, that one char[] array is currently showing up as ~14% of the memory allocated when making a simple get request with ManagedHandler.

Related to dotnet/corefx#16456
cc: @safern, @geoffkizer, @CIPop

Metadata

Metadata

Assignees

Labels

area-System.NetenhancementProduct code improvement that does NOT require public API changes/additionstenet-performancePerformance related issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions