UriHelper.BuildRelative: opportunity for performance improvement #28904
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
design-proposal
This issue represents a design proposal for a different issue, linked in the description
feature-http-abstractions
Milestone
Summary
UriHelper.BuildRelative
creates an intermediary string for the combined path that is used only for concatenating with the other components to create the final URL.Motivation and goals
This method is frequently use in hot paths like redirect and rewrite rules.
Detailed design
Single_Concat
Given that the final URL is composed of only 3 or 4 parts, the use of
string.Concat
is both time and memory efficient.String_Create
string.Create
could be used. But it's just as memory efficient asstring.Concat
and less time efficient is most cases.Benchmarks
Code
The text was updated successfully, but these errors were encountered: