Skip to content
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

OData Client performance guideline to add custom model loader when not using auto-generated code #318

Open
habbes opened this issue Jul 23, 2024 · 0 comments

Comments

@habbes
Copy link
Contributor

habbes commented Jul 23, 2024

When customers create a client using DataServiceContext (without using ODataConnectedService or OData CLI), they usually experience high latencies and CPU usage hikes. This is because, by default, OData Client will fetch the $metadata endpoint and parse the csdl to get the IEdmModel on each request. The solution to this problem is to provide a customer IEdmModel loader delegate. This delegate will be called by OData Client on each request, overriding the default behaviour. To make this call efficient, the customer loader should cache the model to avoid parsing or building the model on each request. This guideline is actually already documented in our guides, but the performance impact is not emphasized, and it's a detail that's easy to miss.

I suggest we add a new section to the performance guidelines documentation that talks about this problem and the solution.

Sample customer issue: OData/odata.net#3015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant