OData + EF - 1 Execution of complex queries takes minutes
Closed this issue · 1 comments
kipperfish commented
We're using your view generator to speed up startup time. All seems to be well with simple queries (based solely on a single model), but when we make requests with many models (via OData) the 1st execution can take over 2 minutes, subsequent executions (even against different IDs) take a few hundred milliseconds.
moozzyk commented
I guess you need to figure out where the time is being spent. View generation may not be the issue here (in fact, view generation in the latest versions of EF has been vastly improved so you may not even see any difference if you stop using this library). A few common themes causing slow application start up are:
- model discovery/building
- query compilation and caching (this might be not only at start up but also when EF sees a complicated query for the first time and it needs to compile it)
- view generation (probably not relevant for small to medium models)
I think OData may add some overhead too.
I recommend starting from reading Performance Considerations and isolating the issue to fix. Currently it does not seem like you know what really needs fixing.