-
Notifications
You must be signed in to change notification settings - Fork 191
Don't allocate for ResponseCookiesFeature #699
Conversation
d3c7782
to
668f574
Compare
/// <see cref="IResponseCookiesFeature"/> and the <see cref="IHttpResponseFeature"/>. | ||
/// </param> | ||
/// <param name="builderPool">The <see cref="ObjectPool{T}"/>, if available.</param> | ||
public ResponseCookiesFeature(IFeatureCollection features, ObjectPool<StringBuilder> builderPool) |
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.
Side note: we can't remove public API (even if we change the behavior).
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.
Restored. Do I need to add back AppendToStringBuilder
on SetCookieHeaderValue
?
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.
Yes, it was public in v1.0
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.
Restored
7d5188b
to
e8e4f7c
Compare
Could also use string.Concat with a single Continually appending to the string is obv problematic, but the cookie is both known size and a known number of strings. |
The string.concat option sounds like it's worth a try. |
Would be 2 allocations, 1 for array another for string, I'm thinking about extracting inplace string formatting into a struct, it would look like
Could reuse it in #716 too. |
@benaadams how do you feel about moving this PR to use dotnet/extensions#157 ? |
Yep |
Need to wait till stuff builds locally :-/ |
@benaadams ping |
Still can't build
Etc |
Hmm, does that when I use ./build is ok in VS but can't run tests |
babb29a
to
debeab2
Compare
@pakrym updated |
You have old version of dotnet sdk somewhere, check what dotnet.exe gets used because
was fixed long long time ago. |
Is there a reason why the |
Resolves #676
/cc @davidfowl @muratg @Tratcher @pakrym