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.

Reduce collection wrapping #426

Closed
Closed
@Tratcher

Description

@Tratcher

There are several cases where low level APIs produce a basic IDictionary or similar, but then we wrap it in a IFoo : IDictionary to make it more user friendly. These wrappers cause lots of extra allocations on each request, resulting in lots of GCs. The main culperates are request headers, response headers, query, form, and cookies.

Headers we can fix by moving IHeaderDictionary into the Features package, use it for IHttpRequestFeature.Headers & IHttpResponseFeature.Headers, and have the servers implement it directly. This is a little more work for the servers, but it removes a wrapper layer. We'll still need the old wrapper implementation for tests though.

Query, Form, and Cookies we can address by having the callers create a collection that implements IDictionary and their own interface (IQueryCollection, IFormCollection, and ICookiesCollection), and having the parser add everything to the provided IDictionary.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions