-
Notifications
You must be signed in to change notification settings - Fork 475
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
Performance Regression from 7.5.12 -> 7.6.3 Microsoft.AspNetCore.OData #2745
Comments
@stack111 could you do some profiling to determine what is triggering the issue or where the issue is. |
I performed a 20 sec sample using visual studio 2022 cpu performance profiler. This is my first time using VS2022 profiler, but I believe I found some useful insights into the modules. Hopefully this helps.
|
As a more detailed reference - I'm attaching profiler's output: I've executed the same request to my application for two Microsoft.AspNet.OData versions. Microsoft.AspNet.OData 7.5.14: Problem occurs only for OData entity having computed collection property. We see UPDATE: Effectively for every loaded assembly and every (public) Type is executed That all is repeated for every returned OData response record! |
In IEnumerable<KeyValuePair<IEdmStructuralProperty, PathSelectItem>> GetPropertiesToWrite(SelectExpandNode selectExpandNode, ResourceContext resourceContext)
If a property is a complex type collection then type is not a IEdmStructuredTypeReference and AsStructured returns BadEntityTypeReference which causes reflecting over all assemblies. Something like |
Short summary (3-5 sentences) describing the issue.
We have a AspNetCore service running OData
Assemblies affected
*Which assemblies and versions are known to be affected e.g. OData WebApi lib 6.1.0
7.6.3
Reproduce steps
The simplest set of steps to reproduce the issue. If possible, reference a commit that demonstrates the issue.
Perf affected controller
Expected result
In our test environment we would not have seen a 100ms 99th percentile increase in latency from the nuget package upgrade from 7.5.12 -> 7.6.3.
Actual result
With a very vacuum controlled steady flow of requests (test environment) we observed requests increase significantly (seconds) after isolating the only change to the NuGet upgrade. We reverted the NuGet upgrade and the latency recovered back to expected behavior.
Additional detail
Example OData queries which are affected follow
/odata/accounts?$filter=partitionKey eq 'e58ec759-cdd4-42d9-af7b-807214f4a456' and (state eq 'Activated' or state eq 'Locked')
The text was updated successfully, but these errors were encountered: