Entity Framework Performance Problem
- by Steve Horn
I'm hoping that someone can help me understand how to overcome a performance problem I'm running into with the latest version of the Entity Framework. In my test, I created my model from a database consisting of around 80 tables.
The problem that I'm running into is that the cost of the very first query I run on a thread is very expensive. If I run without pre-compiling views the first query takes anywhere from 5800 to 6600 milliseconds. If I pre-compile the views (see this article) I can get the initial query cost down to about 2800 to 3200 milliseconds. 3 seconds for each request is still unacceptable for my needs.
Subsequent queries are very fast.
Can you please help me understand how to eliminate the poor performance of the initial query?
I'm using the version of entity framework that ships with Visual Studio 2010 RC.