With a WCF built on top of a DB containing around 200 tables and Entity Framework, it takes lot of time (around 2 mins) to perform login the first time after building the WCF.
Stepping into the code revealed the IQueryable.Count method to be the culprit.
This happens only the first time after building the WCF code. Consecutive execution of the Count method is fast as expected.
What could be the reason? Is entities doing some kind of a background caching of sort after rebuilding the code?
Please share your thoughts!
UPDATED:
@Craig: Thanks for the Pre-Generation of views link
Also, this link has lot of performance improvement suggestions for EF
Also, check out Lazy Loading for EF library.