Don't allocate the FormFeature eagerly per request #2699
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
feature-http-abstractions
Needs: Design
This issue requires design work before implementating.
Perf
Milestone
From @davidfowl on Thursday, June 29, 2017 8:01:27 AM
Today, in order to pass the form options to the
FormFeature
, we eagerly allocate it here https://github.com/aspnet/HttpAbstractions/blob/163836fe1f31dd1d2b288659c2dcaf1d827da3c4/src/Microsoft.AspNetCore.Http/HttpContextFactory.cs#L49. We should find a creative way to avoid doing this so eagerly in the common cases. Here are some options:FormOptions
if they were overridden. We'd need a way to detect if theFormOptions
were actually set. This is doable but could get ugly as there's no way to detect if options were configured. /cc @HaoKFormFeature
if the request is a POST andHasFormContentType
. Gross, but would be more pay for play than what we have today./cc @vancem @Tratcher
Copied from original issue: aspnet/HttpAbstractions#880
The text was updated successfully, but these errors were encountered: