Skip to content

Microsoft.AspNetCore.OData v8.0.3 Thoughts And Performance #359

@xuzhg

Description

@xuzhg

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions