-
Notifications
You must be signed in to change notification settings - Fork 153
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
WebApiAssembliesResolver class missing causing slow model build #1207
Comments
@habbes have you seen this in your performance investigations? Looks pretty massive at first glance although it might require a more elaborate project sample to reproduce the gains. Scanning assemblies can be incredibly inefficient. This might be one of those areas where using a source generator could help immensely. |
The performance bottleneck is this:
I never used 7.x version but I believe original class WebApiAssembliesResolver was there to solve this issue. |
Assemblies affected
ASP.NET Core OData 8.x
Describe the bug
ASP.NET Core OData 7.x had a special class
WebApiAssembliesResolver
that used to access only assemblies available to the application. Now ASP.NET Core OData 8.x moved ModelBuilder to a separate assemby but looks like this class is missing and now replaced with:Now this class is easy to implement:
And provide to EDM builder (don't forget to add
WebApiAssembliesResolver
as singleton elsewhere):On my relatively small project on my fast developer machine I managed to reduce model load time from 7 seconds (230 assemblies!) to 0.5 seconds (5 assemblies!).
Am I doing something incorrect? Should this class be provided instead of DefaultAssemblyResolver how it was in OData 7.x ?
The text was updated successfully, but these errors were encountered: