-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Small improvements to reduce allocations in validation filter logic #62056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Greetings human! You've submitted a PR that modifies code that is shared with https://github.com/dotnet/runtime . Please make sure you synchronize this code with the changes in that repo! |
Co-authored-by: captainsafia <[email protected]>
@gfoidl Thanks for posting these comments! I've been trying out the new Copilot feature to see how helpful it can be. One of its limitations is that it only responds to feedback from the person who initiated it. I'll go through your comments and add them under my own review so the agent can be triggered. |
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.
Good start! More feedback to address here.
…ve code style Co-authored-by: captainsafia <[email protected]>
@BrennanConroy Thoughts on this change? It didn't execute on all the items in the original list but I think this change is good as is. One thing to note is that we have no benchmarks for the validation filter specifically (that's my bad) so we don't have a good way of getting numbers here but assuming the change doesn't break any tests the delta here feels straightforward to review. |
I'm implementing improvements to reduce allocations in the validation filter logic. Here's my progress so far:
ValidationEndpointFilterFactory.Create
for parameters that don't require validationValidationContext
reuse throughout the pipeline to avoid creating new ones per handler argumentEndpointFilterDelegate
returned from the filter factoryValidatableTypeInfo
These changes will make the validation filter logic more efficient and pay-to-play, reducing allocations when users are not leveraging the feature.
Fixes #61222.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.