-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Improve HeaderSplit perf #9309
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
Improve HeaderSplit perf #9309
Conversation
This PR:
My slight modification:
SplitManyHeaders is slower. |
foreach (var segment in new HeaderSegmentCollection(values)) | ||
{ | ||
if (!StringSegment.IsNullOrEmpty(segment.Data)) | ||
{ | ||
var value = DeQuote(segment.Data.Value); | ||
if (!string.IsNullOrEmpty(value)) | ||
{ | ||
yield return value; | ||
result = StringValues.Concat(in result, value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't use in
now that StringValues
is only a pointer size dotnet/extensions#1283
OTOH there isn't currently a Concat overload that takes (StringValues values, string value)
without the in
so may also want to add that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can look at this in future changes. How much would it help?
This comment was made automatically. If there is a problem contact ryanbrandenburg. I've triaged the above build. |
Related to #3737 ? |
It looks like this PR will make #3737 irrelevant since you're inlining the implementation. |
Also did an experimental change and got:
But it relied on moving some of the parsing logic into the
HeaderSplit
method.