Closed
Description
We want to reduce the number of allocations accumulated by the validation filter logic and make the implementation as pay-to-play as possible. When users are not leveraging the feature we should consider:
- Avoiding allocating arrays to construct
IValidatableInfo
instances for parameters that don't require them - Reuse
ValidationContext
objects throughout the pipeline to avoid newing them up per handler argument - Avoid closure allocations in
EndpointFilterDelegate
returned from the filter factory - Cache reflection calls for implemented subtypes in
ValidatableTypeInfo