OData / OData/AspNetCoreOData

Microsoft.AspNetCore.OData v8.0.3 Thoughts And Performance

Open
#359 1 comment 0 reactions 1 assignee View on GitHub

@Sreejithpin is already working on this.

Since Nov 9, 2021.

performance
Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Description

there's some serious performance issue when returning the result from the ODataController. I've tested with 2 endpoints, one endpoint is OData enabled and another without OData. Both are using the exact same repository, domain services...etc to get the data from the same Redis cache. The only difference is one is OData enabled (EnableQuery and EDM setup).

Tested with Postman and the endpoint without OData returns the full set of data to Postman in ~100 milliseconds whereas the endpoint with OData returns the full set of data to Postman ~13 seconds (13000 milliseconds). Please refer to the following:

Endpoint without OData: ~100 milliseconds

image

Endpoint with OData: ~13 seconds (13000 milliseconds)

image

I understand that if I use $select in OData it will reduce the return time (more properties = more time to process) but I just do not understand why there is such a big difference.
There's an article somewhere that mentions something to do with how the internal OData code is using Reflection to set up the Query options. Is there any way I can avoid using reflection or anything I'm missing here to configure it properly, for example, setting up the relationships, properties in EDM help to reduce the use of reflection maybe?

I'm using .NET Core 3.1, Microsoft.AspNetCore.OData 8.0.3. The EDM model is just setup with 1 EntitySet and 1 bounded function.

It'll be great if you can respond and provide some advice.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.