Entity Framework Request Speed

I recently started learning the Entity Framework.

The first question posed in my mind:

When we want to use LINQ to retrieve data in EF, each query looks like this:

var a = from p in contacts select p.name ; 

will be converted to SQL commands as follows:

 select name from contacts 
  • Is this conversion repeated every time we request?
  • I heard that stored procedures are cached in the database, does this event occur in LINQ queries in the Entity Framework?

And finally my question is clear?

+6
performance linq-to-entities entity-framework entity-framework-4
source share
2 answers

All sorts of optimizations are performed, both in caching linq expressions and in what the SQL server chooses for caching, the only way is to measure your speed and memory consumption.

To find out which SQL is created, you can use http://efprof.com/ , which I found pretty good. You can get some information from the SQL profiler, this is much more.

+5
source share

I think the linq query is converted every time you want to execute it. You can use compiled queries to improve performance.

+7
source share

All Articles