Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

ResponseCookies.Append() allocates lots, big lots #561

Closed
@dougbu

Description

@dougbu

Despite using StringValuess, ResponseCookies.Append() is very allocation-heavy. Even just reusing the StringBuilder created in SetCookieHeaderValue.ToString() would be a significant improvement.

For example, running a scenario that adds an Antiforgery token to every response (~156 characters in the token in this case) allocates almost 1 KB extra per response. That's more than 2% of the allocations in this scenario.

Data for 3000 requests:
responsecookies append strings
responsecookies append chars

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions